| 1070 | // Returns the location of the next end-of-line sequence. |
| 1071 | |
| 1072 | StringPiece 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 |
nothing calls this directly
no test coverage detected