Skip to content

Commit 371cd9c

Browse files
committed
fix: simplify comparing markers
1 parent d18fbd1 commit 371cd9c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/datatip-manager.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,7 @@ export class DataTipManager {
450450
// OPTIMIZATION:
451451
// if there is an overlay already on the same position, skip showing the datatip
452452
const decorations = editor.getOverlayDecorations().filter((decoration) => {
453-
const decorationMarker = decoration.getMarker()
454-
if (decorationMarker.compare(highlightMarker) == 1) {
455-
return decoration
456-
}
457-
return null
453+
return decoration.getMarker().compare(highlightMarker) === 1
458454
})
459455
if (decorations.length > 0) {
460456
highlightMarker.destroy()

0 commit comments

Comments
 (0)