MCPcopy Create free account
hub / github.com/cel-expr/cel-go / NewBufferAndLineOffsetsWithLimit

Function NewBufferAndLineOffsetsWithLimit

common/runes/buffer.go:143–148  ·  view source on GitHub ↗

NewBufferAndLineOffsetsWithLimit returns an efficient implementation of Buffer for the given text and enforces a code point limit while constructing the buffer.

(data string, limit int)

Source from the content-addressed store, hash-verified

141// NewBufferAndLineOffsetsWithLimit returns an efficient implementation of Buffer for the given text
142// and enforces a code point limit while constructing the buffer.
143func NewBufferAndLineOffsetsWithLimit(data string, limit int) (Buffer, []int32, error) {
144 if limit < 0 || len(data) <= limit {
145 return newBufferWithLimit(data, true, -1)
146 }
147 return newBufferWithLimit(data, true, limit)
148}
149
150func countRemainingCodePoints(data string, idx int, count int) int {
151 for idx < len(data) {

Calls 1

newBufferWithLimitFunction · 0.85