Added clarification comments

This commit is contained in:
Jasmina Malicevic
2022-12-22 00:01:10 +01:00
parent a8a2dec170
commit 69a8793fa4
2 changed files with 6 additions and 1 deletions

View File

@@ -142,6 +142,10 @@ func lookForHeight(conditions []query.Condition) (int64, bool, int) {
return 0, false, -1
}
// Remove all occurrences of height equality queries except one. While we are traversing the conditions, check whether the only condition in
// addition to match events is the height equality or height range query. At the same time, if we do have a height range condition
// ignore the height equality condition. If a height equality exists, place the condition index in the query and the desired height
// into the heightInfo struct
func dedupHeight(conditions []query.Condition) (dedupConditions []query.Condition, heightInfo HeightInfo, found bool) {
heightInfo.heightEqIdx = -1
heightRangeExists := false

View File

@@ -77,7 +77,8 @@ func (qr QueryRange) UpperBoundValue() interface{} {
}
// LookForRanges returns a mapping of QueryRanges and the matching indexes in
// the provided query conditions.
// the provided query conditions. If we are matching attributes within events
// we need to remember the height range from the condition
func LookForRanges(conditions []query.Condition) (ranges QueryRanges, indexes []int, heightRange QueryRange) {
ranges = make(QueryRanges)
for i, c := range conditions {