Skip to content

Commit 61bbdde

Browse files
yofferik-krogh
andauthored
Apply suggestions from code review
Co-authored-by: Erik Krogh Kristensen <[email protected]>
1 parent c08f94e commit 61bbdde

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/ql/src/semmle/python/regex.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ abstract class RegexString extends Expr {
397397

398398
pragma[inline]
399399
private predicate isOctal(int index) {
400-
this.getChar(index) in ["0", "1", "2", "3", "4", "5", "6", "7"]
400+
this.getChar(index) in [0..7].toString()
401401
}
402402

403403
/** Holds if `index` is inside a character set. */
@@ -709,7 +709,7 @@ abstract class RegexString extends Expr {
709709
value = svalue.toInt() and
710710
// value is composed of digits
711711
forall(int i | i in [start + 1 .. start + len - 1] |
712-
this.getChar(i) in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
712+
this.getChar(i) in [0..9].toString()
713713
) and
714714
// a longer reference is not possible
715715
not (

0 commit comments

Comments
 (0)