Skip to content

Commit 46ecf45

Browse files
[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.
1 parent 31b8ba5 commit 46ecf45

File tree

1 file changed

+2
-2
lines changed
  • llvm/include/llvm/Support

1 file changed

+2
-2
lines changed

llvm/include/llvm/Support/JSON.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ class Value {
318318
Value(std::string V) : Type(T_String) {
319319
if (LLVM_UNLIKELY(!isUTF8(V))) {
320320
assert(false && "Invalid UTF-8 in value used as JSON");
321-
V = fixUTF8(std::move(V));
321+
V = fixUTF8(V);
322322
}
323323
create<std::string>(std::move(V));
324324
}
@@ -591,7 +591,7 @@ class ObjectKey {
591591
ObjectKey(std::string S) : Owned(new std::string(std::move(S))) {
592592
if (LLVM_UNLIKELY(!isUTF8(*Owned))) {
593593
assert(false && "Invalid UTF-8 in value used as JSON");
594-
*Owned = fixUTF8(std::move(*Owned));
594+
*Owned = fixUTF8(*Owned);
595595
}
596596
Data = *Owned;
597597
}

0 commit comments

Comments
 (0)