Skip to content

Commit aa7215b

Browse files
committed
Address review comments
1 parent 5afd2d5 commit aa7215b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

shared/util/codeql/util/DenseRank.qll

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
/** Provides modules for computing dense `rank`s. */
1+
/**
2+
* Provides modules for computing dense `rank`s. See the `DenseRank` module
3+
* below for a more detailed explanation.
4+
*/
25

36
/** Provides the input to `DenseRank`. */
47
signature module DenseRankInputSig {
@@ -77,15 +80,15 @@ signature module DenseRankInputSig2 {
7780
module DenseRank2<DenseRankInputSig2 Input> {
7881
private import Input
7982

80-
private int rank0(C c, Ranked r, int rnk) {
83+
private int rankRank(C c, Ranked r, int rnk) {
8184
rnk = getRank(c, r) and
8285
rnk = rank[result](int rnk0 | rnk0 = getRank(c, _) | rnk0)
8386
}
8487

8588
/** Gets the dense rank of `r` in the context provided by `c`. */
8689
int denseRank(C c, Ranked r) {
8790
exists(int rnk |
88-
result = rank0(c, r, rnk) and
91+
result = rankRank(c, r, rnk) and
8992
rnk = getRank(c, r)
9093
)
9194
}
@@ -113,15 +116,15 @@ signature module DenseRankInputSig3 {
113116
module DenseRank3<DenseRankInputSig3 Input> {
114117
private import Input
115118

116-
private int rank0(C1 c1, C2 c2, Ranked r, int rnk) {
119+
private int rankRank(C1 c1, C2 c2, Ranked r, int rnk) {
117120
rnk = getRank(c1, c2, r) and
118121
rnk = rank[result](int rnk0 | rnk0 = getRank(c1, c2, _) | rnk0)
119122
}
120123

121124
/** Gets the dense rank of `r` in the context provided by `c1` and `c2`. */
122125
int denseRank(C1 c1, C2 c2, Ranked r) {
123126
exists(int rnk |
124-
result = rank0(c1, c2, r, rnk) and
127+
result = rankRank(c1, c2, r, rnk) and
125128
rnk = getRank(c1, c2, r)
126129
)
127130
}

0 commit comments

Comments
 (0)