From b8a73943a0643b97336e06609511af252bf034a8 Mon Sep 17 00:00:00 2001 From: Ahsan Barkati Date: Tue, 31 Aug 2021 20:55:23 +0530 Subject: [PATCH] upgrade sroar --- codec/codec.go | 7 +++---- go.mod | 2 +- go.sum | 4 ++-- query/recurse.go | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/codec/codec.go b/codec/codec.go index 40372622d26..0079d753c5c 100644 --- a/codec/codec.go +++ b/codec/codec.go @@ -134,7 +134,7 @@ func Merge(matrix []*pb.List) *sroar.Bitmap { func FromList(l *pb.List) *sroar.Bitmap { if l == nil { - return nil + return sroar.NewBitmap() } // Keep the check for bitmap before sortedUids because we expect to have bitmap very often if len(l.Bitmap) > 0 { @@ -145,13 +145,12 @@ func FromList(l *pb.List) *sroar.Bitmap { bm.SetMany(l.SortedUids) return bm } - // TODO: Return nil here and handle nil for all the APIs in sroar itself. return sroar.NewBitmap() } func FromListNoCopy(l *pb.List) *sroar.Bitmap { if l == nil { - return nil + return sroar.NewBitmap() } // Keep the check for bitmap before sortedUids because we expect to have bitmap very often if len(l.Bitmap) > 0 { @@ -162,7 +161,7 @@ func FromListNoCopy(l *pb.List) *sroar.Bitmap { bm.SetMany(l.SortedUids) return bm } - return nil + return sroar.NewBitmap() } func FromBytes(buf []byte) *sroar.Bitmap { diff --git a/go.mod b/go.mod index 37d465476c0..f1769a940fe 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/dgraph-io/graphql-transport-ws v0.0.0-20210511143556-2cef522f1f15 github.com/dgraph-io/ristretto v0.1.1-0.20210824115121-89e99415887a github.com/dgraph-io/simdjson-go v0.3.0 - github.com/dgraph-io/sroar v0.0.0-20210830053543-c5aff93143f7 + github.com/dgraph-io/sroar v0.0.0-20210831151133-ad6554cce45c github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 diff --git a/go.sum b/go.sum index bf672ffd575..856d96bef19 100644 --- a/go.sum +++ b/go.sum @@ -182,8 +182,8 @@ github.com/dgraph-io/ristretto v0.1.1-0.20210824115121-89e99415887a h1:2+hTlwc5y github.com/dgraph-io/ristretto v0.1.1-0.20210824115121-89e99415887a/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgraph-io/simdjson-go v0.3.0 h1:h71LO7vR4LHMPUhuoGN8bqGm1VNfGOlAG8BI6iDUKw0= github.com/dgraph-io/simdjson-go v0.3.0/go.mod h1:Otpysdjaxj9OGaJusn4pgQV7OFh2bELuHANq0I78uvY= -github.com/dgraph-io/sroar v0.0.0-20210830053543-c5aff93143f7 h1:GUNuYUk6Owo1GIxwDxiIDXSn/T3fgpxWbiXmnKFq5Ig= -github.com/dgraph-io/sroar v0.0.0-20210830053543-c5aff93143f7/go.mod h1:bdNPtQmcxoIQVkZEWZvX0n0/IDlHFab397xdBlP4OoE= +github.com/dgraph-io/sroar v0.0.0-20210831151133-ad6554cce45c h1:bHaFPV/3WghTvYa3deF8atHQWk85yfEwFlRgMu89SSo= +github.com/dgraph-io/sroar v0.0.0-20210831151133-ad6554cce45c/go.mod h1:bdNPtQmcxoIQVkZEWZvX0n0/IDlHFab397xdBlP4OoE= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 h1:CaO/zOnF8VvUfEbhRatPcwKVWamvbYd8tQGRWacE9kU= diff --git a/query/recurse.go b/query/recurse.go index f19e43af132..801e2a511b4 100644 --- a/query/recurse.go +++ b/query/recurse.go @@ -129,7 +129,7 @@ func (start *SubGraph) expandRecurse(ctx context.Context, maxDepth uint64) error } else { ul := sg.uidMatrix[mIdx] ur := codec.FromListNoCopy(ul) - if ur == nil { + if ur.IsEmpty() { continue }