[all-commits] [llvm/llvm-project] 2f851f: [ADT] Forward some StringRef::find overloads to st...

Benjamin Kramer via All-commits all-commits at lists.llvm.org
Sun Jan 15 12:23:07 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2f851f26ead0ea68c110584674555562af07d9e1
      https://github.com/llvm/llvm-project/commit/2f851f26ead0ea68c110584674555562af07d9e1
  Author: Benjamin Kramer <benny.kra at googlemail.com>
  Date:   2023-01-15 (Sun, 15 Jan 2023)

  Changed paths:
    M llvm/include/llvm/ADT/StringRef.h
    M llvm/lib/Support/StringRef.cpp

  Log Message:
  -----------
  [ADT] Forward some StringRef::find overloads to std::string_view

These are identical in terms of functionality and performance (checked
libc++ and libstdc++). We could do the same for rfind, but that actually
has a off-by one on its position argument.

StringRef::find(StringRef) seems to be quite a bit more optimized than
the standard library one, so leave it alone.




More information about the All-commits mailing list