Skip to content

Commit

Permalink
Merge pull request #288 from github/lcartey/rule-7-4-perf
Browse files Browse the repository at this point in the history
Rule 7.4: Improve performance
  • Loading branch information
lcartey committed Mar 31, 2023
2 parents 966f5c3 + 7dfca8f commit 576499a
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ class WideCharPointerType extends PointerType {
override string getAPrimaryQlClass() { result = "WideCharPointerType" }
}

class GenericCharPointerType extends PointerType {
class GenericCharPointerType extends Type {
GenericCharPointerType() {
/* This type resolves to wchar_t* (which is in turn a typedef depending on its implementation) */
this.resolveTypedefs*() instanceof WideCharPointerType
// A wide char pointer type
this instanceof WideCharPointerType
or
/* This type eventually resolves to char* */
this.resolveTypedefs*() instanceof CharPointerType
// A char pointer type
this.getUnspecifiedType() instanceof CharPointerType
or
// A typedef to any such type.
// Note: wchar_t is usually a typedef, so we cannot just use getUnspecifiedType() here.
this.(TypedefType).getBaseType() instanceof GenericCharPointerType
}
}

Expand Down

0 comments on commit 576499a

Please sign in to comment.