Skip to content

Commit 3975f6e

Browse files
committed
fix(comments): use in operator for position key lookup
Avoids rebuilding Object.keys() array per comment in getFloatingComments filter.
1 parent 404f445 commit 3975f6e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/superdoc/src/stores/comments-store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ export const useCommentsStore = defineStore('comments', () => {
881881
// selection.source) must have a live position in the document.
882882
if (!isEditorBackedComment(c)) return true;
883883
const commentKey = c.commentId || c.importedId;
884-
return Object.keys(editorCommentPositions.value).includes(commentKey);
884+
return commentKey in editorCommentPositions.value;
885885
});
886886
return comments;
887887
});

0 commit comments

Comments
 (0)