Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit ab65fc4

Browse files
author
Antonio Scandurra
committed
Use & instead of % to determine if a number is odd or even
1 parent efc5a22 commit ab65fc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/display-layer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,11 +723,11 @@ class DisplayLayer {
723723
}
724724

725725
isOpenTag (tag) {
726-
return tag < 0 && tag % 2 === -1
726+
return tag < 0 && (tag & 1) === 1
727727
}
728728

729729
isCloseTag (tag) {
730-
return tag < 0 && tag % 2 === 0
730+
return tag < 0 && (tag & 1) === 0
731731
}
732732

733733
bufferWillChange (change) {

0 commit comments

Comments
 (0)