Skip to content

Commit 72266cb

Browse files
committed
PS: Drive-by cleanup in Constant.qll
1 parent b9fdc78 commit 72266cb

File tree

1 file changed

+3
-12
lines changed
  • powershell/ql/lib/semmle/code/powershell/ast/internal

1 file changed

+3
-12
lines changed

powershell/ql/lib/semmle/code/powershell/ast/internal/Constant.qll

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
private import AstImport
2+
private import codeql.util.Boolean
23

34
private newtype TConstantValue =
45
TConstInteger(int value) {
@@ -12,15 +13,7 @@ private newtype TConstantValue =
1213
)
1314
} or
1415
TConstString(string value) { exists(Raw::StringLiteral sl | sl.getValue() = value) } or
15-
TConstBoolean(boolean value) {
16-
exists(Raw::VarAccess va |
17-
value = true and
18-
va.getUserPath() = "true"
19-
or
20-
value = false and
21-
va.getUserPath() = "false"
22-
)
23-
} or
16+
TConstBoolean(Boolean b) or
2417
TNull()
2518

2619
/** A constant value. */
@@ -61,9 +54,7 @@ class ConstInteger extends ConstantValue, TConstInteger {
6154

6255
final override string serialize() { result = this.getValue() }
6356

64-
final override ConstExpr getAnExpr() {
65-
result.getValueString() = this.getValue()
66-
}
57+
final override ConstExpr getAnExpr() { result.getValueString() = this.getValue() }
6758
}
6859

6960
/** A constant floating point value. */

0 commit comments

Comments
 (0)