add comments to explain perf sensitive code

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

@ -149,7 +149,8 @@ export default async function preprocess(
filename
});
if (processed) {
if (!processed) continue;
if (processed.dependencies) dependencies.push(...processed.dependencies);
source = processed.code;
if (processed.map) {
@ -160,7 +161,6 @@ export default async function preprocess(
);
}
}
}
async function preprocess_tag_content(tag_name: 'style' | 'script', preprocessor: Preprocessor) {
const get_location = getLocator(source);

@ -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