[lld] 4972a19 - [wasm] Use StringRef::trim (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 26 23:56:28 PST 2023


Author: Kazu Hirata
Date: 2023-12-26T23:56:21-08:00
New Revision: 4972a19702a00ce0a66d66d38b982c706a008ec8

URL: https://github.com/llvm/llvm-project/commit/4972a19702a00ce0a66d66d38b982c706a008ec8
DIFF: https://github.com/llvm/llvm-project/commit/4972a19702a00ce0a66d66d38b982c706a008ec8.diff

LOG: [wasm] Use StringRef::trim (NFC)

Added: 
    

Modified: 
    lld/wasm/InputFiles.cpp

Removed: 
    


################################################################################
diff  --git a/lld/wasm/InputFiles.cpp b/lld/wasm/InputFiles.cpp
index 96ac1e1610dd3b..5709a5ced584c7 100644
--- a/lld/wasm/InputFiles.cpp
+++ b/lld/wasm/InputFiles.cpp
@@ -680,16 +680,7 @@ Symbol *ObjFile::createUndefined(const WasmSymbol &sym, bool isCalledDirectly) {
   llvm_unreachable("unknown symbol kind");
 }
 
-
-StringRef strip(StringRef s) {
-  while (s.starts_with(" ")) {
-    s = s.drop_front();
-  }
-  while (s.ends_with(" ")) {
-    s = s.drop_back();
-  }
-  return s;
-}
+StringRef strip(StringRef s) { return s.trim(' '); }
 
 void StubFile::parse() {
   bool first = true;


        


More information about the llvm-commits mailing list