From 4972a19702a00ce0a66d66d38b982c706a008ec8 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 26 Dec 2023 23:56:21 -0800 Subject: [wasm] Use StringRef::trim (NFC) --- lld/wasm/InputFiles.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'lld') diff --git a/lld/wasm/InputFiles.cpp b/lld/wasm/InputFiles.cpp index 96ac1e1..5709a5c 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; -- cgit v1.1