aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-11-01 23:20:27 -0700
committerGitHub <noreply@github.com>2025-11-01 23:20:27 -0700
commit46ecf458e16bde0b5784d1cfe7837f683e54ee0d (patch)
tree7160e05d530006d1b6196ead34b09492d364b40b
parent31b8ba56708b8967300f9fca11dae5d272462d7d (diff)
downloadllvm-46ecf458e16bde0b5784d1cfe7837f683e54ee0d.zip
llvm-46ecf458e16bde0b5784d1cfe7837f683e54ee0d.tar.gz
llvm-46ecf458e16bde0b5784d1cfe7837f683e54ee0d.tar.bz2
[Support] Drop unnecessary std::move in JSON.h (NFC) (#166027)
fixUTF8 takes StringRef, so we do not need std::move here. Identified with performance-move-const-arg.
-rw-r--r--llvm/include/llvm/Support/JSON.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h
index a973c56..ecaadd2 100644
--- a/llvm/include/llvm/Support/JSON.h
+++ b/llvm/include/llvm/Support/JSON.h
@@ -318,7 +318,7 @@ public:
Value(std::string V) : Type(T_String) {
if (LLVM_UNLIKELY(!isUTF8(V))) {
assert(false && "Invalid UTF-8 in value used as JSON");
- V = fixUTF8(std::move(V));
+ V = fixUTF8(V);
}
create<std::string>(std::move(V));
}
@@ -591,7 +591,7 @@ public:
ObjectKey(std::string S) : Owned(new std::string(std::move(S))) {
if (LLVM_UNLIKELY(!isUTF8(*Owned))) {
assert(false && "Invalid UTF-8 in value used as JSON");
- *Owned = fixUTF8(std::move(*Owned));
+ *Owned = fixUTF8(*Owned);
}
Data = *Owned;
}