Update Proxy / CDN / Download Hosts

Chore: minor infra changes

Update CDN Hosts
This commit is contained in:
SukkaW
2024-08-02 18:16:18 +08:00
parent 7f6e631847
commit 855e1bf69b
8 changed files with 24 additions and 49 deletions

View File

@@ -9,7 +9,7 @@ export function appendArrayInPlace<T>(dest: T[], source: T[]) {
dest.push.apply(dest, source);
} else {
while (itemsLeft > 0) {
const pushCount = Math.min(MAX_BLOCK_SIZE, itemsLeft);
const pushCount = itemsLeft > MAX_BLOCK_SIZE ? MAX_BLOCK_SIZE : itemsLeft;
const subSource = source.slice(offset, offset + pushCount);
// eslint-disable-next-line prefer-spread -- performance
dest.push.apply(dest, subSource);

View File

@@ -7,11 +7,8 @@ import fsp from 'fs/promises';
const file = path.resolve(__dirname, '../../Source/domainset/cdn.conf');
group('read file by line', () => {
bench('readline', () => processLineFromReadline(readFileByLine(file)));
bench('readFileByLine', () => processLineFromReadline(readFileByLine(file)));
bench('fsp.readFile', () => fsp.readFile(file, 'utf-8').then((content) => content.split('\n').filter(processLine)));
bench('Bun.file', () => Bun.file(file).text().then((content) => content.split('\n').filter(processLine)));
});
run();