MCPcopy
hub / github.com/grafana/dskit / stringsCut

Function stringsCut

tenant/tenant.go:157–163  ·  view source on GitHub ↗

stringsCut is like strings.Cut but uses strings.IndexByte instead.

(s string, sep byte)

Source from the content-addressed store, hash-verified

155
156// stringsCut is like strings.Cut but uses strings.IndexByte instead.
157func stringsCut(s string, sep byte) (string, string, bool) {
158 idx := strings.IndexByte(s, sep)
159 if idx == -1 {
160 return s, "", false
161 }
162 return s[:idx], s[idx+1:], true
163}

Callers 5

ParseMetadataFunction · 0.85
IterMethod · 0.85
TenantIDFunction · 0.85
ParseWithMetadataFunction · 0.85
BenchmarkStringsCutFunction · 0.85

Calls

no outgoing calls

Tested by 1

BenchmarkStringsCutFunction · 0.68