Ruby: fix 'inefficient string comparison' alert

This commit is contained in:
Nick Rolfe
2022-08-26 09:58:22 +01:00
parent 95bf18fdc9
commit 52d46552af

View File

@@ -79,7 +79,7 @@ module HardcodedDataInterpretedAsCode {
forex(StringComponentCfgNode c |
c = this.asExpr().(ExprNodes::StringlikeLiteralCfgNode).getAComponent()
|
c.getNode().(AST::StringEscapeSequenceComponent).getRawText().prefix(2) = "\\x"
c.getNode().(AST::StringEscapeSequenceComponent).getRawText().matches("\\x%")
)
}
}