Skip to content

Commit d0af30b

Browse files
committed
cleanup the implementation of toString() for `SuperCall
1 parent db49cfb commit d0af30b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ruby/ql/lib/codeql/ruby/ast/Call.qll

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,7 @@ class MethodCall extends Call instanceof MethodCallImpl {
125125
*/
126126
final predicate isSafeNavigation() { super.isSafeNavigationImpl() }
127127

128-
override string toString() {
129-
if this instanceof SuperCall
130-
then result = "super call to " + this.getMethodName()
131-
else result = "call to " + this.getMethodName()
132-
}
128+
override string toString() { result = "call to " + this.getMethodName() }
133129

134130
override AstNode getAChild(string pred) {
135131
result = Call.super.getAChild(pred)
@@ -214,6 +210,8 @@ class YieldCall extends Call instanceof YieldCallImpl {
214210
*/
215211
class SuperCall extends MethodCall instanceof SuperCallImpl {
216212
final override string getAPrimaryQlClass() { result = "SuperCall" }
213+
214+
override string toString() { result = "super call to " + this.getMethodName() }
217215
}
218216

219217
/**

0 commit comments

Comments
 (0)