This may be slightly more efficient and is definitely more readable.
llvm-svn: 165217
// FIXME: This is searching much more than necessary, but I am
// blanking on the simplest way to make it fast. We can solve this
// problem when we move to TableGen.
+ StringRef StrRef(Str);
for (; Start != End; ++Start) {
// Scan for first option which is a proper prefix.
for (; Start != End; ++Start)
- if (strncmp(Str, Start->Name, strlen(Start->Name)) == 0)
+ if (StrRef.startswith(Start->Name))
break;
if (Start == End)
break;