mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
C++: Remove unnecessary recursion through Node.toString.
This commit is contained in:
@@ -201,7 +201,7 @@ module SourceSinkInterpretationInput implements
|
||||
string toString() {
|
||||
result = this.asElement().toString()
|
||||
or
|
||||
result = this.asNode().toString()
|
||||
result = this.asNode().toStringImpl()
|
||||
or
|
||||
result = this.asCall().toString()
|
||||
}
|
||||
|
||||
@@ -968,7 +968,7 @@ private class Node0 extends Node, TNode0 {
|
||||
|
||||
override Location getLocationImpl() { result = node.getLocation() }
|
||||
|
||||
override string toStringImpl() { result = node.toString() }
|
||||
override string toStringImpl() { result = node.toStringImpl() }
|
||||
|
||||
override Type getType() { result = node.getType() }
|
||||
|
||||
@@ -1020,7 +1020,9 @@ class PostFieldUpdateNode extends PostUpdateNodeImpl {
|
||||
|
||||
Field getUpdatedField() { result = this.getFieldAddress().getField() }
|
||||
|
||||
override string toStringImpl() { result = this.getPreUpdateNode() + " [post update]" }
|
||||
override string toStringImpl() {
|
||||
result = this.getPreUpdateNode().toStringImpl() + " [post update]"
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1187,9 +1189,7 @@ private class RawIndirectOperand0 extends Node, TRawIndirectOperand0 {
|
||||
else result instanceof UnknownLocation
|
||||
}
|
||||
|
||||
override string toStringImpl() {
|
||||
result = stars(this) + operandNode(this.getOperand()).toStringImpl()
|
||||
}
|
||||
override string toStringImpl() { result = stars(this) + operandToString(this.getOperand()) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1232,7 +1232,7 @@ private class RawIndirectInstruction0 extends Node, TRawIndirectInstruction0 {
|
||||
}
|
||||
|
||||
override string toStringImpl() {
|
||||
result = stars(this) + instructionNode(this.getInstruction()).toStringImpl()
|
||||
result = stars(this) + instructionToString(this.getInstruction())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user