diff --git a/Sources/Brave/Frontend/Browser/Helpers/LaunchHelper.swift b/Sources/Brave/Frontend/Browser/Helpers/LaunchHelper.swift index 254477c3178..6918578f363 100644 --- a/Sources/Brave/Frontend/Browser/Helpers/LaunchHelper.swift +++ b/Sources/Brave/Frontend/Browser/Helpers/LaunchHelper.swift @@ -128,16 +128,17 @@ private extension FilterListStorage { var validBlocklistTypes: Set { if filterLists.isEmpty { /// If we don't have filter lists yet loaded, use the settings - return allFilterListSettings.reduce(Set()) { partialResult, setting in - guard let componentId = setting.componentId else { return partialResult } - return partialResult.union([ + return allFilterListSettings.reduce(into: Set(), { partialResult, setting in + guard let componentId = setting.componentId else { return } + + partialResult.formUnion([ .filterList(componentId: componentId, isAlwaysAggressive: setting.isAlwaysAggressive) ]) - } + }) } else { /// If we do have filter lists yet loaded, use them as they are always the most up to date and accurate - return filterLists.reduce(Set()) { partialResult, filterList in - return partialResult.union([ + return filterLists.reduce(into: Set()) { partialResult, filterList in + partialResult.formUnion([ .filterList(componentId: filterList.entry.componentId, isAlwaysAggressive: filterList.isAlwaysAggressive) ]) }