CompareRowNumbers compares the sequences of row numbers in a and b for partial equality, descending from top-level through the given definition level. For example, definition level 1 means that row numbers are compared at two levels of nesting, the top-level and 1 level of nesting below.
(upToDefinitionLevel int, a, b RowNumber)
| 56 | // at two levels of nesting, the top-level and 1 level of nesting |
| 57 | // below. |
| 58 | func CompareRowNumbers(upToDefinitionLevel int, a, b RowNumber) int { |
| 59 | for i := 0; i <= upToDefinitionLevel; i++ { |
| 60 | if a[i] < b[i] { |
| 61 | return -1 |
| 62 | } |
| 63 | if a[i] > b[i] { |
| 64 | return 1 |
| 65 | } |
| 66 | } |
| 67 | return 0 |
| 68 | } |
| 69 | |
| 70 | // EqualRowNumber compares the sequences of row numbers in a and b |
| 71 | // for partial equality. A little faster than CompareRowNumbers(d,a,b)==0 |
no outgoing calls