MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ConsumeNextPart

Function ConsumeNextPart

tensorflow/core/framework/rendezvous.cc:71–83  ·  view source on GitHub ↗

Return the prefix of "*s" up to the next occurrence of "delim", or the whole remaining string if "delim" is not found. "*s" is advanced past the string returned plus the delimiter (if found).

Source from the content-addressed store, hash-verified

69// the whole remaining string if "delim" is not found. "*s" is advanced
70// past the string returned plus the delimiter (if found).
71static StringPiece ConsumeNextPart(StringPiece* s, char delim) {
72 for (size_t offset = 0; offset < s->size(); offset++) {
73 if ((*s)[offset] == delim) {
74 StringPiece result(s->data(), offset);
75 s->remove_prefix(offset + 1); // +1: remove delim, as well
76 return result;
77 }
78 }
79 // No delimiter found: return rest of string
80 StringPiece result(s->data(), s->size());
81 s->remove_prefix(s->size());
82 return result;
83}
84
85/* static */
86Status Rendezvous::ParseKey(StringPiece key, ParsedKey* out) {

Callers 1

ParseKeyMethod · 0.85

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected