- // If `hostName` is not `null`, check all the subdomains of `hostName` against wildcard domains in `domainCursor`.
- if (hostName != null) {
- while (hostName.contains(".") && !domainSettingsApplied) { // Stop checking if we run out of `.` or if we already know that `domainSettingsApplied` is `true`.
- if (domainSettingsSet.contains("*." + hostName)) { // Check the host name prepended by `*.`.
- domainSettingsApplied = true;
- domainNameInDatabase = "*." + hostName;
- }
+ // Check all the subdomains of the host name against wildcard domains in the domain cursor.
+ while (!domainSettingsApplied && hostName.contains(".")) { // Stop checking if domain settings are already applied or there are no more `.` in the host name.
+ if (domainSettingsSet.contains("*." + hostName)) { // Check the host name prepended by `*.`.
+ // Apply the domain settings.
+ domainSettingsApplied = true;