MCPcopy Create free account
hub / github.com/CPChain/chain / isBatch

Function isBatch

api/rpc/json.go:125–134  ·  view source on GitHub ↗

isBatch returns true when the first non-whitespace characters is '['

(msg json.RawMessage)

Source from the content-addressed store, hash-verified

123
124// isBatch returns true when the first non-whitespace characters is '['
125func isBatch(msg json.RawMessage) bool {
126 for _, c := range msg {
127 // skip insignificant whitespace (http://www.ietf.org/rfc/rfc4627.txt)
128 if c == 0x20 || c == 0x09 || c == 0x0a || c == 0x0d {
129 continue
130 }
131 return c == '['
132 }
133 return false
134}
135
136// ReadRequestHeaders will read new requests without parsing the arguments. It will
137// return a collection of requests, an indication if these requests are in batch

Callers 2

readMethod · 0.85
ReadRequestHeadersMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected