Ruby: simplify predicate

This commit is contained in:
Nick Rolfe
2022-04-19 11:28:32 +01:00
parent ac805f0cdc
commit 468c718da0

View File

@@ -54,14 +54,16 @@ class StringSubstitutionCall extends DataFlow::CallNode {
* Gets the string value passed as the first (pattern) argument in this call,
* if any.
*/
string getPatternString() { result = this.getArgument(0).asExpr().getConstantValue().getString() }
string getPatternString() {
result = this.getPatternArgument().asExpr().getConstantValue().getString()
}
/**
* Gets the string value passed as the second (replacement) argument in this
* call, if any.
*/
string getReplacementString() {
result = this.getArgument(1).asExpr().getConstantValue().getString()
result = this.getReplacementArgument().asExpr().getConstantValue().getString()
}
/** Gets a string that is being replaced by this call. */