Skip to content

Commit

Permalink
fix: CustomArrayDict
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaoumov committed Nov 3, 2024
1 parent 59733a1 commit 31714c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/obsidian/implementations/CustomArrayDictImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@ export class CustomArrayDictImpl<T> implements CustomArrayDict<T> {
values.remove(value);

if (values.length === 0) {
this.removeKey(key);
this.clear(key);
}
}

public removeKey(key: string): void {
this.data.delete(key);
}

public get(key: string): T[] | null {
return this.data.get(key) || null;
}
Expand All @@ -40,7 +36,7 @@ export class CustomArrayDictImpl<T> implements CustomArrayDict<T> {
}

public clear(key: string): void {
this.removeKey(key);
this.data.delete(key);
}

public clearAll(): void {
Expand Down
1 change: 0 additions & 1 deletion src/obsidian/internals/CustomArrayDict.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ export interface CustomArrayDict<T> {
get(key: string): T[] | null;
keys(): string[];
remove(key: string, value: T): void;
removeKey(key: string): void;
}

0 comments on commit 31714c2

Please sign in to comment.