mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-02 12:01:53 +08:00
Perf/Refactor: processDomainList now returns string[]
This commit is contained in:
@@ -2,7 +2,12 @@
|
||||
* In-place adding of elements from an array to a set.
|
||||
*/
|
||||
export function setAddFromArray<T>(set: Set<T>, arr: T[]): void {
|
||||
for (let i = 0, len = arr.length; i < len; i++) {
|
||||
set.add(arr[i]);
|
||||
}
|
||||
// for (let i = 0, len = arr.length; i < len; i++) {
|
||||
// set.add(arr[i]);
|
||||
// }
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method -- thisArg is passed
|
||||
arr.forEach(set.add, set);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method -- thisArg is passed
|
||||
export const setAddFromArrayCurried = <T>(set: Set<T>) => (arr: T[]) => arr.forEach(set.add, set);
|
||||
|
||||
Reference in New Issue
Block a user