Skip to content

Commit

Permalink
fix(sroar): Bring latest sroar to master (#7977)
Browse files Browse the repository at this point in the history
Bring the latest sroar to master.
  • Loading branch information
ahsanbarkati authored Aug 10, 2021
1 parent f181a70 commit ecc001f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions codec/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ func FromBytes(buf []byte) *sroar.Bitmap {
}

func FromBackup(buf []byte) *sroar.Bitmap {
r := sroar.NewBitmap()
var prev uint64
var uids []uint64
for len(buf) > 0 {
uid, n := binary.Uvarint(buf)
if uid == 0 {
Expand All @@ -182,14 +182,14 @@ func FromBackup(buf []byte) *sroar.Bitmap {
buf = buf[n:]

next := prev + uid
r.Set(next)
uids = append(uids, next)
prev = next
}
return r
return sroar.FromSortedList(uids)
}

func ToUids(plist *pb.PostingList, start uint64) []uint64 {
r := sroar.FromBuffer(plist.Bitmap)
r := sroar.FromBufferWithCopy(plist.Bitmap)
r.RemoveRange(0, start)
return r.ToArray()
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/dgraph-io/graphql-transport-ws v0.0.0-20210511143556-2cef522f1f15
github.com/dgraph-io/ristretto v0.1.0
github.com/dgraph-io/simdjson-go v0.3.0
github.com/dgraph-io/sroar v0.0.0-20210604145002-865050cb7465
github.com/dgraph-io/sroar v0.0.0-20210810060359-2dcd866b0b1f
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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/Lu
github.com/dgraph-io/ristretto v0.1.0/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-20210604145002-865050cb7465 h1:wj9EEeLJyJnopcmtJlw5TzOcEgudIYLWGDE3cBpYUBQ=
github.com/dgraph-io/sroar v0.0.0-20210604145002-865050cb7465/go.mod h1:bdNPtQmcxoIQVkZEWZvX0n0/IDlHFab397xdBlP4OoE=
github.com/dgraph-io/sroar v0.0.0-20210810060359-2dcd866b0b1f h1:t0+mRMDoMgWykf89mPKW9RaeFb3ujM7HoISogMXsaDo=
github.com/dgraph-io/sroar v0.0.0-20210810060359-2dcd866b0b1f/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=
Expand Down
4 changes: 2 additions & 2 deletions posting/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func (l *List) bitmap(opt ListOptions) (*sroar.Bitmap, error) {
}
r := sroar.NewBitmap()
if deleteBelow == 0 {
r = sroar.FromBuffer(l.plist.Bitmap)
r = sroar.FromBufferWithCopy(l.plist.Bitmap)
if iw != nil {
r.And(iw)
}
Expand All @@ -533,7 +533,7 @@ func (l *List) bitmap(opt ListOptions) (*sroar.Bitmap, error) {
if err != nil {
return nil, errors.Wrapf(err, "while reading a split with startUid: %d", startUid)
}
s := sroar.FromBuffer(split.Bitmap)
s := sroar.FromBufferWithCopy(split.Bitmap)

// Intersect with opt.Intersect.
if iw != nil {
Expand Down

0 comments on commit ecc001f

Please sign in to comment.