Revert accidental commit.

While this is a fun change, I didn't really test it :)

llvm-svn: 232897
This commit is contained in:
Benjamin Kramer 2015-03-21 15:37:32 +00:00
parent 691363e7f2
commit 65025aa89d
1 changed files with 3 additions and 6 deletions

View File

@ -238,12 +238,9 @@ namespace llvm {
/// \returns The index of the first occurrence of \p C, or npos if not
/// found.
size_t find(char C, size_t From = 0) const {
if (Length != 0) {
size_t FindBegin = std::min(From, Length);
if (const void *Found =
std::memchr(Data + FindBegin, C, Length - FindBegin))
return static_cast<const char *>(Found) - Data;
}
for (size_t i = std::min(From, Length), e = Length; i != e; ++i)
if (Data[i] == C)
return i;
return npos;
}