Skip to content

Commit c1a6c51

Browse files
author
aiday-mar
committed
Refactoring the code
1 parent 8a8fb8d commit c1a6c51

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,8 @@ export class StickyLineCandidateProvider extends Disposable {
112112
}
113113
let lastLine = lastStartLineNumber;
114114
const childrenStartLines = outlineModel.children.map(child => child.range?.startLineNumber as number);
115-
let indexLower = binarySearch(childrenStartLines, range.startLineNumber, (a: number, b: number) => { return a - b; });
116-
let indexUpper = binarySearch(childrenStartLines, range.startLineNumber + depth, (a: number, b: number) => { return a - b; });
117-
indexLower = this.updatedIndex(indexLower);
118-
indexUpper = this.updatedIndex(indexUpper);
115+
const indexLower = this.updatedIndex(binarySearch(childrenStartLines, range.startLineNumber, (a: number, b: number) => { return a - b; }));
116+
const indexUpper = this.updatedIndex(binarySearch(childrenStartLines, range.startLineNumber + depth, (a: number, b: number) => { return a - b; }));
119117

120118
for (let i = indexLower; i <= indexUpper; i++) {
121119
const child = outlineModel.children[i];

0 commit comments

Comments
 (0)