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

Function FindEol

be/src/gutil/strings/util.cc:1072–1086  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1070// Returns the location of the next end-of-line sequence.
1071
1072StringPiece FindEol(StringPiece s) {
1073 for (size_t i = 0; i < s.length(); ++i) {
1074 if (s[i] == '\n') {
1075 return StringPiece(s.data() + i, 1);
1076 }
1077 if (s[i] == '\r') {
1078 if (i+1 < s.length() && s[i+1] == '\n') {
1079 return StringPiece(s.data() + i, 2);
1080 } else {
1081 return StringPiece(s.data() + i, 1);
1082 }
1083 }
1084 }
1085 return StringPiece(s.data() + s.length(), 0);
1086}
1087
1088} // namespace strings
1089

Callers

nothing calls this directly

Calls 3

StringPieceClass · 0.70
lengthMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected