Skip to content

Commit 468c718

Browse files
committed
Ruby: simplify predicate
1 parent ac805f0 commit 468c718

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ruby/ql/lib/codeql/ruby/frameworks/core/String.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,16 @@ class StringSubstitutionCall extends DataFlow::CallNode {
5454
* Gets the string value passed as the first (pattern) argument in this call,
5555
* if any.
5656
*/
57-
string getPatternString() { result = this.getArgument(0).asExpr().getConstantValue().getString() }
57+
string getPatternString() {
58+
result = this.getPatternArgument().asExpr().getConstantValue().getString()
59+
}
5860

5961
/**
6062
* Gets the string value passed as the second (replacement) argument in this
6163
* call, if any.
6264
*/
6365
string getReplacementString() {
64-
result = this.getArgument(1).asExpr().getConstantValue().getString()
66+
result = this.getReplacementArgument().asExpr().getConstantValue().getString()
6567
}
6668

6769
/** Gets a string that is being replaced by this call. */

0 commit comments

Comments
 (0)