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

Method find_first_not_of

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

Source from the content-addressed store, hash-verified

142}
143
144int StringPiece::find_first_not_of(StringPiece s, size_type pos) const {
145 if (length_ <= 0) return npos;
146 if (s.length_ <= 0) return 0;
147 // Avoid the cost of BuildLookupTable() for a single-character search.
148 if (s.length_ == 1) return find_first_not_of(s.ptr_[0], pos);
149
150 bool lookup[UCHAR_MAX + 1] = { false };
151 BuildLookupTable(s, lookup);
152 for (int i = pos; i < length_; ++i) {
153 if (!lookup[static_cast<unsigned char>(ptr_[i])]) {
154 return i;
155 }
156 }
157 return npos;
158}
159
160int StringPiece::find_first_not_of(char c, size_type pos) const {
161 if (length_ <= 0) return npos;

Callers 5

SplitStringIntoKeyValuesFunction · 0.80
ShellEscapeFunction · 0.80
ParquetFileVersionMethod · 0.80
ParseSmapsMethod · 0.80

Calls 1

BuildLookupTableFunction · 0.85

Tested by

no test coverage detected