Commit 14486ce6 authored by Kenton Varda's avatar Kenton Varda

Oops, memrchr is a GNU extension.

parent 4a14f8e1
...@@ -402,12 +402,12 @@ inline Maybe<size_t> StringPtr::findFirst(char c) const { ...@@ -402,12 +402,12 @@ inline Maybe<size_t> StringPtr::findFirst(char c) const {
} }
inline Maybe<size_t> StringPtr::findLast(char c) const { inline Maybe<size_t> StringPtr::findLast(char c) const {
const char* pos = reinterpret_cast<const char*>(memrchr(content.begin(), c, size())); for (size_t i = size(); i > 0; --i) {
if (pos == nullptr) { if (content[i-1] == c) {
return nullptr; return i-1;
} else { }
return pos - content.begin();
} }
return nullptr;
} }
inline String::operator ArrayPtr<char>() { inline String::operator ArrayPtr<char>() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment