From dd59f799475a4383191e6858e7dda16cc6f331c8 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Wed, 18 Aug 2021 11:09:03 +0200 Subject: [PATCH] use min() instead of rank[1]() --- cpp/ql/lib/semmle/code/cpp/PrintAST.qll | 2 +- .../code/cpp/ir/implementation/aliased_ssa/IRConsistency.qll | 2 +- .../lib/semmle/code/cpp/ir/implementation/raw/IRConsistency.qll | 2 +- .../code/cpp/ir/implementation/unaliased_ssa/IRConsistency.qll | 2 +- .../ql/src/experimental/ir/implementation/raw/IRConsistency.qll | 2 +- .../ir/implementation/unaliased_ssa/IRConsistency.qll | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/PrintAST.qll b/cpp/ql/lib/semmle/code/cpp/PrintAST.qll index c0aaa0e2c6b..86b39a285b0 100644 --- a/cpp/ql/lib/semmle/code/cpp/PrintAST.qll +++ b/cpp/ql/lib/semmle/code/cpp/PrintAST.qll @@ -46,7 +46,7 @@ private string escapeString(string s) { * string representation comes first in lexicographical order. */ private Location getRepresentativeLocation(Locatable ast) { - result = rank[1](Location loc | loc = ast.getLocation() | loc order by loc.toString()) + result = min(Location loc | loc = ast.getLocation() | loc order by loc.toString()) } /** diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IRConsistency.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IRConsistency.qll index f331f4c87bf..31983d34247 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IRConsistency.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/IRConsistency.qll @@ -35,7 +35,7 @@ module InstructionConsistency { // To avoid an overwhelming number of results when the extractor merges functions with the // same name, just pick a single location. result = - rank[1](Language::Location loc | loc = irFunc.getLocation() | loc order by loc.toString()) + min(Language::Location loc | loc = irFunc.getLocation() | loc order by loc.toString()) } } diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/IRConsistency.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/IRConsistency.qll index f331f4c87bf..31983d34247 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/IRConsistency.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/IRConsistency.qll @@ -35,7 +35,7 @@ module InstructionConsistency { // To avoid an overwhelming number of results when the extractor merges functions with the // same name, just pick a single location. result = - rank[1](Language::Location loc | loc = irFunc.getLocation() | loc order by loc.toString()) + min(Language::Location loc | loc = irFunc.getLocation() | loc order by loc.toString()) } } diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/IRConsistency.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/IRConsistency.qll index f331f4c87bf..31983d34247 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/IRConsistency.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/IRConsistency.qll @@ -35,7 +35,7 @@ module InstructionConsistency { // To avoid an overwhelming number of results when the extractor merges functions with the // same name, just pick a single location. result = - rank[1](Language::Location loc | loc = irFunc.getLocation() | loc order by loc.toString()) + min(Language::Location loc | loc = irFunc.getLocation() | loc order by loc.toString()) } } diff --git a/csharp/ql/src/experimental/ir/implementation/raw/IRConsistency.qll b/csharp/ql/src/experimental/ir/implementation/raw/IRConsistency.qll index f331f4c87bf..31983d34247 100644 --- a/csharp/ql/src/experimental/ir/implementation/raw/IRConsistency.qll +++ b/csharp/ql/src/experimental/ir/implementation/raw/IRConsistency.qll @@ -35,7 +35,7 @@ module InstructionConsistency { // To avoid an overwhelming number of results when the extractor merges functions with the // same name, just pick a single location. result = - rank[1](Language::Location loc | loc = irFunc.getLocation() | loc order by loc.toString()) + min(Language::Location loc | loc = irFunc.getLocation() | loc order by loc.toString()) } } diff --git a/csharp/ql/src/experimental/ir/implementation/unaliased_ssa/IRConsistency.qll b/csharp/ql/src/experimental/ir/implementation/unaliased_ssa/IRConsistency.qll index f331f4c87bf..31983d34247 100644 --- a/csharp/ql/src/experimental/ir/implementation/unaliased_ssa/IRConsistency.qll +++ b/csharp/ql/src/experimental/ir/implementation/unaliased_ssa/IRConsistency.qll @@ -35,7 +35,7 @@ module InstructionConsistency { // To avoid an overwhelming number of results when the extractor merges functions with the // same name, just pick a single location. result = - rank[1](Language::Location loc | loc = irFunc.getLocation() | loc order by loc.toString()) + min(Language::Location loc | loc = irFunc.getLocation() | loc order by loc.toString()) } }