add comments to explain perf sensitive code

pull/5584/head
halfnelson 5 years ago
parent 21f73389ff
commit b07e99c351

@ -149,16 +149,16 @@ export default async function preprocess(
filename
});
if (processed) {
if (processed.dependencies) dependencies.push(...processed.dependencies);
source = processed.code;
if (processed.map) {
sourcemap_list.unshift(
typeof(processed.map) === 'string'
? JSON.parse(processed.map)
: processed.map
);
}
if (!processed) continue;
if (processed.dependencies) dependencies.push(...processed.dependencies);
source = processed.code;
if (processed.map) {
sourcemap_list.unshift(
typeof(processed.map) === 'string'
? JSON.parse(processed.map)
: processed.map
);
}
}

@ -59,6 +59,8 @@ function merge_tables<T>(this_table: T[], other_table: T[]): [T[], number[], boo
}
function pushArray<T>(_this: T[], other: T[]) {
// We use push to mutate in place for memory and perf reasons
// We use the for loop instead of _this.push(...other) to avoid the JS engine's function argument limit (65,535 in JavascriptCore)
for (let i = 0; i < other.length; i++) {
_this.push(other[i]);
}

Loading…
Cancel
Save