mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 15:33:56 +08:00
refactor(desktop): classify added line checks in one pass (#17324)
This commit is contained in:
@@ -212,18 +212,16 @@ export const addedLineChecks = (
|
||||
}
|
||||
lineStart = lineEnd + 1;
|
||||
}
|
||||
const classified = added
|
||||
.filter((line) => !unexamined.has(line))
|
||||
.map((line) => ({
|
||||
line,
|
||||
at: classifications.get(line) ?? -1,
|
||||
}));
|
||||
const whole = classified.filter(({ at }) => at < 0).map(({ line }) => line);
|
||||
const whole: string[] = [];
|
||||
const prefixes = new Set<string>();
|
||||
let unnamed = 0;
|
||||
for (const { line, at } of classified.filter(
|
||||
({ at }) => counted && at >= 0,
|
||||
)) {
|
||||
for (const line of added.filter((value) => !unexamined.has(value))) {
|
||||
const at = classifications.get(line) ?? -1;
|
||||
if (at < 0) {
|
||||
whole.push(line);
|
||||
continue;
|
||||
}
|
||||
if (!counted) continue;
|
||||
const prefix = line.slice(0, at).trimStart();
|
||||
const equals = holding(lines.after, prefix);
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user