[all-commits] [llvm/llvm-project] 9223cc: Avoid std::string -> (char *) roundtrip in createS...

Adrian Prantl via All-commits all-commits at lists.llvm.org
Thu May 23 16:52:17 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9223ccb0e56d6d4de17808e2e4000c8019a9a218
      https://github.com/llvm/llvm-project/commit/9223ccb0e56d6d4de17808e2e4000c8019a9a218
  Author: Adrian Prantl <aprantl at apple.com>
  Date:   2024-05-23 (Thu, 23 May 2024)

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

  Log Message:
  -----------
  Avoid std::string -> (char *) roundtrip in createStringError() (NFC) (#93242)

The current API first creates a temporary std::string, then passes it as
a C string, only to then convert it into a std::string for storage, thus
unnecessarily computing the length of the string and copying it.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list