Skip to content

Commit 6863c60

Browse files
authored
small improvement with direct assignment instead of addition assignment (#1297)
1 parent ef70ddd commit 6863c60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/slang-nodes/SlangNode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export class SlangNode {
134134

135135
if (start - leadingOffset === loc.start) {
136136
loc.leadingOffset = leadingOffset;
137-
loc.start += leadingOffset;
137+
loc.start = start;
138138
break;
139139
}
140140
}
@@ -147,7 +147,7 @@ export class SlangNode {
147147

148148
if (end + trailingOffset === loc.end) {
149149
loc.trailingOffset = trailingOffset;
150-
loc.end -= trailingOffset;
150+
loc.end = end;
151151
break;
152152
}
153153
}

0 commit comments

Comments
 (0)