Use efficient filters

This commit is contained in:
Andras Schmelczer 2025-12-07 11:30:19 +00:00
parent 07cb8491e2
commit 4005da4849
13 changed files with 82 additions and 47 deletions

View file

@ -15,7 +15,7 @@ export class MockAgent extends MockClient {
private readonly pendingActions: Promise<unknown>[] = [];
// The renamed file finding algorithm isn't too smart so we can't both update and rename the same file
private doNotTouchWhileOffline: string[] = [];
private readonly doNotTouchWhileOffline: string[] = [];
public constructor(
initialSettings: Partial<SyncSettings>,
@ -54,10 +54,10 @@ export class MockAgent extends MockClient {
);
if (historyEntry) {
this.doNotTouchWhileOffline =
this.doNotTouchWhileOffline.filter(
(file) => file !== historyEntry[1]
);
utils.removeFromArray(
this.doNotTouchWhileOffline,
historyEntry[1]
);
}
switch (logLine.level) {
case LogLevel.ERROR: