Skip to content

Commit 187ece6

Browse files
committed
C#: Only evaluate api name and namespace strings if they are needed.
1 parent 366b94a commit 187ece6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

csharp/ql/src/Telemetry/ExternalApi.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class ExternalApi extends DotNet::Callable {
3737
/**
3838
* Gets the unbound type, name and parameter types of this API.
3939
*/
40+
bindingset[this]
4041
private string getSignature() {
4142
result =
4243
this.getDeclaringType().getUnboundDeclaration() + "." + this.getName() + "(" +
@@ -46,11 +47,13 @@ class ExternalApi extends DotNet::Callable {
4647
/**
4748
* Gets the namespace of this API.
4849
*/
50+
bindingset[this]
4951
string getNamespace() { this.getDeclaringType().hasQualifiedName(result, _) }
5052

5153
/**
5254
* Gets the namespace and signature of this API.
5355
*/
56+
bindingset[this]
5457
string getApiName() { result = this.getNamespace() + "#" + this.getSignature() }
5558

5659
/** Gets a node that is an input to a call to this API. */

0 commit comments

Comments
 (0)