diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-07-13 18:01:26 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-07-13 18:01:26 +0200 |
commit | 9137aa22a5240bc1d9d0b5583be384bc716060aa (patch) | |
tree | 39c656435385a0a3109bdc6540b918d5dc8a04ab /skate/zipkey | |
parent | e98ccb9c906230edcd5673acefba21b6eda80080 (diff) | |
download | refcat-9137aa22a5240bc1d9d0b5583be384bc716060aa.tar.gz refcat-9137aa22a5240bc1d9d0b5583be384bc716060aa.zip |
reduce: small tweaks
Diffstat (limited to 'skate/zipkey')
-rw-r--r-- | skate/zipkey/batch.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/skate/zipkey/batch.go b/skate/zipkey/batch.go index f8b945c..6ab7eee 100644 --- a/skate/zipkey/batch.go +++ b/skate/zipkey/batch.go @@ -55,7 +55,7 @@ func (b *Batcher) Close() error { return b.err } -// GroupFunc is a drop for a groupFunc. Use this function, where you used +// GroupFunc is a drop-in for a groupFunc. Use this function, where you used // grouper before. Not thread safe. Panics if called after Close. func (b *Batcher) GroupFunc(g *Group) error { if b.closing { @@ -63,7 +63,7 @@ func (b *Batcher) GroupFunc(g *Group) error { } b.batch = append(b.batch, g) // A few groups have an extended size, e.g. thousands of members. We short - // curcuit on those. + // curcuit on those to save memory. oversized := len(g.G0) > maxGroupSize || len(g.G1) > maxGroupSize if len(b.batch) == b.Size || oversized { g := make([]*Group, len(b.batch)) @@ -71,7 +71,7 @@ func (b *Batcher) GroupFunc(g *Group) error { b.queue <- g b.batch = nil } - return nil + return b.err } // worker will wind down after any error has been encountered. Multiple threads |