Skip to content

Commit 35f28c8

Browse files
committed
Python: small refactor (reviewer suggestion)
1 parent f5059a6 commit 35f28c8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

python/ql/lib/semmle/python/regexp/RegexTreeView.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,11 @@ module Impl implements RegexTreeViewSig {
263263
/* inclusive vs exclusive */
264264
)
265265
or
266-
exists(StringPart part, int localOffset | part = this.getPart(localOffset) |
267-
filepath = part.getLocation().getFile().getAbsolutePath() and
268-
startline = part.getLocation().getStartLine() and
269-
startcolumn = part.getLocation().getStartColumn() + localOffset and
266+
exists(StringPart part, int localOffset, int partStartColumn |
267+
part = this.getPart(localOffset)
268+
|
269+
part.getLocation().hasLocationInfo(filepath, startline, partStartColumn, _, _) and
270+
startcolumn = partStartColumn + localOffset and
270271
endline = startline and
271272
endcolumn = (end - start) + startcolumn
272273
)

0 commit comments

Comments
 (0)