mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
C#: Address review comments.
This commit is contained in:
@@ -11,6 +11,7 @@ import csharp
|
||||
* This is used for extensionals that can be supplied
|
||||
* as either type references or types.
|
||||
*/
|
||||
cached
|
||||
@type_or_ref getTypeRef(@type type) {
|
||||
result = type
|
||||
or
|
||||
@@ -37,7 +38,7 @@ private module TypeRefs {
|
||||
*/
|
||||
Type getCanonicalType() {
|
||||
result = this.getAType() and
|
||||
isCanonicalType(result)
|
||||
not locationIsBetter(canonicalTypeLocation(result), canonicalTypeLocation(this.getAType()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,11 +64,4 @@ private module TypeRefs {
|
||||
typeLocation.(SourceLocation).getFile().getAbsolutePath() <
|
||||
betterLocation.(SourceLocation).getFile().getAbsolutePath()
|
||||
}
|
||||
|
||||
private predicate isCanonicalType(Type type) {
|
||||
not exists(TypeRef tr |
|
||||
type = tr.getAType() and
|
||||
locationIsBetter(canonicalTypeLocation(type), canonicalTypeLocation(tr.getAType()))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user