MCPcopy Index your code
hub / github.com/maruel/panicparse / trimLeftSpace

Function trimLeftSpace

stack/context.go:1177–1184  ·  view source on GitHub ↗

trimLeftSpace is the faster equivalent of bytes.TrimLeft(s, "\t ").

(s []byte)

Source from the content-addressed store, hash-verified

1175
1176// trimLeftSpace is the faster equivalent of bytes.TrimLeft(s, "\t ").
1177func trimLeftSpace(s []byte) []byte {
1178 for i, ch := range s {
1179 if ch != '\t' && ch != ' ' {
1180 return s[i:]
1181 }
1182 }
1183 return nil
1184}
1185
1186// trimCurlyBrackets is the faster equivalent of
1187// bytes.TrimRight(bytes.TrimLeft(s, "{"), "}"). The function

Callers 2

TestTrimLeftSpaceFunction · 0.85
scanMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestTrimLeftSpaceFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…