From db4c40ac93da239d19fcf321976aedf3aa88a128 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 15 Oct 2024 19:51:26 +0800 Subject: [PATCH] Squash redundant move warnings --- source/compiler-core/slang-artifact-desc-util.cpp | 2 +- source/compiler-core/slang-source-embed-util.cpp | 2 +- source/core/slang-persistent-cache.cpp | 2 +- source/core/slang-string-util.cpp | 4 ++-- source/slang/slang-ast-val.cpp | 2 +- source/slang/slang-compiler.cpp | 2 +- source/slang/slang-ir.cpp | 2 +- source/slang/slang-mangle.cpp | 2 +- source/slang/slang-preprocessor.cpp | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/compiler-core/slang-artifact-desc-util.cpp b/source/compiler-core/slang-artifact-desc-util.cpp index ae7f842272..57102182e4 100644 --- a/source/compiler-core/slang-artifact-desc-util.cpp +++ b/source/compiler-core/slang-artifact-desc-util.cpp @@ -958,7 +958,7 @@ SlangResult ArtifactDescUtil::appendDefaultExtension(const ArtifactDesc& desc, S { StringBuilder buf; appendText(desc, buf); - return std::move(buf); + return buf; } } // namespace Slang diff --git a/source/compiler-core/slang-source-embed-util.cpp b/source/compiler-core/slang-source-embed-util.cpp index 45fd9c4b30..ec0c005cf0 100644 --- a/source/compiler-core/slang-source-embed-util.cpp +++ b/source/compiler-core/slang-source-embed-util.cpp @@ -73,7 +73,7 @@ static bool _isHeaderExtension(const UnownedStringSlice& in) // Assume it's a header, and just use the .h extension StringBuilder buf; buf << path << toSlice(".h"); - return std::move(buf); + return buf; } /* static */SourceEmbedUtil::Style SourceEmbedUtil::getDefaultStyle(const ArtifactDesc& desc) diff --git a/source/core/slang-persistent-cache.cpp b/source/core/slang-persistent-cache.cpp index d934d1b26a..2b4113e168 100644 --- a/source/core/slang-persistent-cache.cpp +++ b/source/core/slang-persistent-cache.cpp @@ -226,7 +226,7 @@ String PersistentCache::getEntryFileName(const Key& key) { StringBuilder str; str << m_cacheDirectory << "/" << key.toString(); - return std::move(str); + return str; } struct CacheIndexHeader diff --git a/source/core/slang-string-util.cpp b/source/core/slang-string-util.cpp index c7625e1e0a..79f7307dcd 100644 --- a/source/core/slang-string-util.cpp +++ b/source/core/slang-string-util.cpp @@ -332,7 +332,7 @@ UnownedStringSlice StringUtil::getAtInSplit(const UnownedStringSlice& in, char s append(format, args, builder); va_end(args); - return std::move(builder); + return builder; } /* static */UnownedStringSlice StringUtil::getSlice(ISlangBlob* blob) @@ -384,7 +384,7 @@ ComPtr StringUtil::createStringBlob(const String& string) } builder.appendInPlace(dstChars, numChars); - return std::move(builder); + return builder; } /* static */String StringUtil::calcCharReplaced(const String& string, char fromChar, char toChar) diff --git a/source/slang/slang-ast-val.cpp b/source/slang/slang-ast-val.cpp index 68a55e5675..f300411750 100644 --- a/source/slang/slang-ast-val.cpp +++ b/source/slang/slang-ast-val.cpp @@ -120,7 +120,7 @@ String Val::toString() { StringBuilder builder; toText(builder); - return std::move(builder); + return builder; } HashCode Val::getHashCode() diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 5bbc92e97d..af44683835 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -940,7 +940,7 @@ namespace Slang { builder << ";" << _getDisplayPath(sink, sourceFiles[i]); } - return std::move(builder); + return builder; } } } diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index f190b3a116..d0dcfd4fbf 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -7684,7 +7684,7 @@ namespace Slang { StringBuilder sb; printSlangIRAssembly(sb, module, options, sourceManager); - return std::move(sb); + return sb; } void dumpIR(IRModule* module, const IRDumpOptions& options, SourceManager* sourceManager, ISlangWriter* writer) diff --git a/source/slang/slang-mangle.cpp b/source/slang/slang-mangle.cpp index 5a0d41f090..93b29ccbe1 100644 --- a/source/slang/slang-mangle.cpp +++ b/source/slang/slang-mangle.cpp @@ -823,7 +823,7 @@ namespace Slang builder << "_Sh"; builder.append(uint64_t(hash), 16); - return std::move(builder); + return builder; } } diff --git a/source/slang/slang-preprocessor.cpp b/source/slang/slang-preprocessor.cpp index c4a2bd95ee..600e28bc5c 100644 --- a/source/slang/slang-preprocessor.cpp +++ b/source/slang/slang-preprocessor.cpp @@ -3487,7 +3487,7 @@ static String _readDirectiveMessage(PreprocessorDirectiveContext* context) result.append(token.getContent()); } - return std::move(result); + return result; } // Handle a `#warning` directive