Skip to content

Commit

Permalink
Words
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed Jun 17, 2024
1 parent 424f24c commit 9719319
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/batch/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package batch

import "fmt"

// BatchBySize takes a slice of elements, encodes them, groups batches of bytes that sum to at most [maxSize], and then p
// passes each of those batches to the [yield] function.
// BySize takes a series of elements, encodes them, groups them into batches of bytes that sum to at most [maxSize], and
// then passes each of those batches to the [yield] function.
func BySize[T any](in []T, maxSize int, encode func(T) ([]byte, error), yield func([][]byte) error) error {
var buffer [][]byte
var currentSize int
Expand Down

0 comments on commit 9719319

Please sign in to comment.