Skip to content

Commit 0e01972

Browse files
fixed comments and tests
1 parent 4cd48db commit 0e01972

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

worker/task.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,17 +1819,17 @@ func langForFunc(langs []string) string {
18191819
return langs[0]
18201820
}
18211821

1822-
func checkUidEmpty(uids []uint64) bool {
1823-
for _, i := range uids {
1824-
if i == 0 {
1822+
func checkUidZero(uids []uint64) bool {
1823+
for _, uid := range uids {
1824+
if uid == 0 {
18251825
return true
18261826
}
18271827
}
18281828
return false
18291829
}
18301830

18311831
func planForEqFilter(fc *functionContext, pred string, uidlist []uint64) {
1832-
if checkUidEmpty(uidlist) {
1832+
if checkUidZero(uidlist) {
18331833
// We have a uid which has 0 in it. Mostly it would happen when there is only 0. But any one item
18341834
// being 0 could cause the query planner to fail. In case of 0 being present, we neeed to query the
18351835
// index itself.
@@ -1913,8 +1913,8 @@ func parseSrcFn(ctx context.Context, q *pb.Query) (*functionContext, error) {
19131913
}
19141914

19151915
generateIneqTokens := true
1916-
if fc.fname != eq && uint64(len(q.UidList.Uids)) < Config.TypeFilterUidLimit {
1917-
if !checkUidEmpty(q.UidList.Uids) {
1916+
if fc.fname != eq && q.UidList != nil && uint64(len(q.UidList.Uids)) < Config.TypeFilterUidLimit {
1917+
if !checkUidZero(q.UidList.Uids) {
19181918
fc.n = len(q.UidList.Uids)
19191919
generateIneqTokens = false
19201920
}

0 commit comments

Comments
 (0)