From fe1f08fb12ae025d19e43bfd969fe86b153f8776 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 3 Dec 2020 15:55:11 +0000 Subject: [PATCH] Use existing predicate There already exists the predicate implements(string pkg, string tp, string name) which does exactly what this code does --- ql/src/semmle/go/frameworks/Encoding.qll | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ql/src/semmle/go/frameworks/Encoding.qll b/ql/src/semmle/go/frameworks/Encoding.qll index 5d91253971b..e575c046a75 100644 --- a/ql/src/semmle/go/frameworks/Encoding.qll +++ b/ql/src/semmle/go/frameworks/Encoding.qll @@ -10,10 +10,8 @@ private class JsonIteratorUnmarshalFunction extends TaintTracking::FunctionModel JsonIteratorUnmarshalFunction() { this.hasQualifiedName("github.com/json-iterator/go", ["Unmarshal", "UnmarshalFromString"]) or - exists(Method m | - m.hasQualifiedName("github.com/json-iterator/go", "API", ["Unmarshal", "UnmarshalFromString"]) and - this.(Method).implements(m) - ) + this.(Method) + .implements("github.com/json-iterator/go", "API", ["Unmarshal", "UnmarshalFromString"]) } override DataFlow::FunctionInput getAnInput() { result.isParameter(0) }