MCPcopy Create free account
hub / github.com/apache/impala / find_first_of

Method find_first_of

be/src/gutil/strings/stringpiece.cc:127–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127int StringPiece::find_first_of(StringPiece s, size_type pos) const {
128 if (length_ <= 0 || s.length_ <= 0) {
129 return npos;
130 }
131 // Avoid the cost of BuildLookupTable() for a single-character search.
132 if (s.length_ == 1) return find_first_of(s.ptr_[0], pos);
133
134 bool lookup[UCHAR_MAX + 1] = { false };
135 BuildLookupTable(s, lookup);
136 for (int i = pos; i < length_; ++i) {
137 if (lookup[static_cast<unsigned char>(ptr_[i])]) {
138 return i;
139 }
140 }
141 return npos;
142}
143
144int StringPiece::find_first_not_of(StringPiece s, size_type pos) const {
145 if (length_ <= 0) return npos;

Callers 12

strrmmFunction · 0.45
JoinCSVLineWithDelimiterFunction · 0.45
FindMethod · 0.45
SplitStringIntoKeyValuesFunction · 0.45
FindNthFunction · 0.45
SetExecutorGroupsFunction · 0.45
ReadProcNetDevLineMethod · 0.45

Calls 1

BuildLookupTableFunction · 0.85

Tested by

no test coverage detected