Skip to content

Commit 0f91e5c

Browse files
committed
getRange for loop optimization - invarient
1 parent 1bb69a5 commit 0f91e5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib_src/misc/cells.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function getRange(editor: TextEditor): [Point, Point] {
1919
cursor.column = Infinity // cursor on delimiter line means eval cell below
2020

2121
let foundDelim = false
22-
for (let i = cursor.row + 1; i <= editor.getLastBufferRow(); i++) {
22+
for (let i = cursor.row + 1, l = editor.getLastBufferRow(); i <= l; i++) {
2323
const { line, scope } = getLine(editor, i)
2424
foundDelim = regex.test(line) && scope.join(".").indexOf("comment.line") > -1
2525
end.row = i

0 commit comments

Comments
 (0)