[PATCH] D92506: Remove memory allocation with string
Aditya Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 4 16:45:53 PST 2020
hiraditya updated this revision to Diff 309697.
hiraditya added a comment.
Rebase
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92506/new/
https://reviews.llvm.org/D92506
Files:
llvm/lib/Option/OptTable.cpp
Index: llvm/lib/Option/OptTable.cpp
===================================================================
--- llvm/lib/Option/OptTable.cpp
+++ llvm/lib/Option/OptTable.cpp
@@ -198,8 +198,8 @@
static bool optionMatches(const OptTable::Info &In, StringRef Option) {
if (In.Prefixes)
for (size_t I = 0; In.Prefixes[I]; I++)
- if (Option.endswith(In.Name))
- if (Option == std::string(In.Prefixes[I]) + In.Name)
+ if (Option.consume_back(In.Name))
+ if (Option.equals(In.Prefixes[I]))
return true;
return false;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92506.309697.patch
Type: text/x-patch
Size: 556 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201205/0e998ad9/attachment.bin>
More information about the llvm-commits
mailing list