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

Function ConsumeNonWhitespace

tensorflow/core/platform/str_util.cc:88–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88bool ConsumeNonWhitespace(StringPiece* s, StringPiece* val) {
89 const char* p = s->data();
90 const char* limit = p + s->size();
91 while (p < limit) {
92 const char c = *p;
93 if (isspace(c)) break;
94 p++;
95 }
96 const size_t n = p - s->data();
97 if (n > 0) {
98 *val = StringPiece(s->data(), n);
99 s->remove_prefix(n);
100 return true;
101 } else {
102 *val = StringPiece();
103 return false;
104 }
105}
106
107bool ConsumePrefix(StringPiece* s, StringPiece expected) {
108 return absl::ConsumePrefix(s, expected);

Callers 4

ComputeMethod · 0.85
ScanWordFunction · 0.85
SplitV2Function · 0.85
TestConsumeNonWhitespaceFunction · 0.85

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by 1

TestConsumeNonWhitespaceFunction · 0.68