[llvm] f88760f - [TableGen] Remove unnecessary StringRef constructor call from LessRecord(). NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu May 16 15:46:58 PDT 2024
Author: Craig Topper
Date: 2024-05-16T15:42:16-07:00
New Revision: f88760f3118a106be847a8d5296931a8e44c72f8
URL: https://github.com/llvm/llvm-project/commit/f88760f3118a106be847a8d5296931a8e44c72f8
DIFF: https://github.com/llvm/llvm-project/commit/f88760f3118a106be847a8d5296931a8e44c72f8.diff
LOG: [TableGen] Remove unnecessary StringRef constructor call from LessRecord(). NFC
Record::getName already returns a StringRef. When this code was
originally written getName returned const std::string &.
Added:
Modified:
llvm/include/llvm/TableGen/Record.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/TableGen/Record.h b/llvm/include/llvm/TableGen/Record.h
index c1b352e974eed..c83f5d0e99fdf 100644
--- a/llvm/include/llvm/TableGen/Record.h
+++ b/llvm/include/llvm/TableGen/Record.h
@@ -2098,7 +2098,7 @@ class RecordKeeper {
/// Sorting predicate to sort record pointers by name.
struct LessRecord {
bool operator()(const Record *Rec1, const Record *Rec2) const {
- return StringRef(Rec1->getName()).compare_numeric(Rec2->getName()) < 0;
+ return Rec1->getName().compare_numeric(Rec2->getName()) < 0;
}
};
More information about the llvm-commits
mailing list