Skip to content

Commit

Permalink
Removed uidlist
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshil Goel committed Sep 15, 2023
1 parent 5fd6e83 commit f8b36a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion algo/uidlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func IntersectCompressedWith(pack *pb.UidPack, afterUID uint64, v, o *pb.List) {
if pack == nil {
return
}
dec := codec.Decoder{Pack: pack, UnpackedBlocks: make(map[int][]uint64)}
dec := codec.Decoder{Pack: pack}
dec.Seek(afterUID, codec.SeekStart)
n := dec.ApproxLen()
m := len(v.Uids)
Expand Down
6 changes: 1 addition & 5 deletions codec/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,12 @@ type Decoder struct {
Pack *pb.UidPack
blockIdx int
uids []uint64

UnpackedBlocks map[int][]uint64
}

// NewDecoder returns a decoder for the given UidPack and properly initializes it.
func NewDecoder(pack *pb.UidPack) *Decoder {
decoder := &Decoder{
Pack: pack,
UnpackedBlocks: make(map[int][]uint64),
Pack: pack
}
decoder.Seek(0, SeekStart)
return decoder
Expand Down Expand Up @@ -215,7 +212,6 @@ func (d *Decoder) UnpackBlock() []uint64 {
}

d.uids = d.uids[:block.NumUids]
d.UnpackedBlocks[d.blockIdx] = append(make([]uint64, 0, len(d.uids)), d.uids...)
return d.uids
}

Expand Down

0 comments on commit f8b36a6

Please sign in to comment.