diff options
author | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 18:39:01 +0100 |
---|---|---|
committer | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 18:39:01 +0100 |
commit | 7c4fbad2ba7d79580a9ebbf9fde1de117be4d08e (patch) | |
tree | f7c8e96e744222857c613e5fd14720d2695613c3 | |
parent | 431a9c00a56cf4c603be1cf5f773b193621d8150 (diff) |
Removed some redundant std::move usages in return statements.
-rw-r--r-- | source/core/StarImageProcessing.cpp | 2 | ||||
-rw-r--r-- | source/core/StarLexicalCast.hpp | 2 | ||||
-rw-r--r-- | source/core/StarMap.hpp | 4 | ||||
-rw-r--r-- | source/core/StarOrderedMap.hpp | 2 | ||||
-rw-r--r-- | source/core/StarSectorArray2D.hpp | 2 | ||||
-rw-r--r-- | source/game/StarInput.cpp | 8 | ||||
-rw-r--r-- | source/game/scripting/StarInputLuaBindings.cpp | 2 |
7 files changed, 11 insertions, 11 deletions
diff --git a/source/core/StarImageProcessing.cpp b/source/core/StarImageProcessing.cpp index 27519bb..a98e7e5 100644 --- a/source/core/StarImageProcessing.cpp +++ b/source/core/StarImageProcessing.cpp @@ -201,7 +201,7 @@ ImageOperation imageOperationFromString(StringView string) { else if (!which || (ptr != end && ++ptr != end)) throw ImageOperationException(strf("Improper size for hex string '{}' in imageOperationFromString", StringView(hexPtr, hexLen)), false); else // we're in A of A=B. In vanilla only A=B pairs are evaluated, so only throw an exception if B is also there. - return std::move(operation); + return operation; which = !which; diff --git a/source/core/StarLexicalCast.hpp b/source/core/StarLexicalCast.hpp index 9e5a4a2..7c43137 100644 --- a/source/core/StarLexicalCast.hpp +++ b/source/core/StarLexicalCast.hpp @@ -30,7 +30,7 @@ Maybe<Type> maybeLexicalCast(StringView s, std::ios_base::fmtflags flags = std:: if (stream >> ch) return {}; - return std::move(result); + return result; } template <typename Type> diff --git a/source/core/StarMap.hpp b/source/core/StarMap.hpp index e3f9d67..187f4cf 100644 --- a/source/core/StarMap.hpp +++ b/source/core/StarMap.hpp @@ -172,7 +172,7 @@ auto MapMixin<BaseMap>::maybeTake(key_type const& k) -> Maybe<mapped_type> { if (i != Base::end()) { mapped_type v = std::move(i->second); Base::erase(i); - return std::move(v); + return v; } return {}; @@ -198,7 +198,7 @@ template <typename BaseMap> auto MapMixin<BaseMap>::value(key_type const& k, mapped_type d) const -> mapped_type { const_iterator i = Base::find(k); if (i == Base::end()) - return std::move(d); + return d; else return i->second; } diff --git a/source/core/StarOrderedMap.hpp b/source/core/StarOrderedMap.hpp index 8c787e0..be99769 100644 --- a/source/core/StarOrderedMap.hpp +++ b/source/core/StarOrderedMap.hpp @@ -242,7 +242,7 @@ template <template <typename...> class Map, typename Key, typename Value, typena auto OrderedMapWrapper<Map, Key, Value, Allocator, MapArgs...>::value(key_type const& k, mapped_type d) const -> mapped_type { auto i = m_map.find(k); if (i == m_map.end()) - return std::move(d); + return d; else return i->second->second; } diff --git a/source/core/StarSectorArray2D.hpp b/source/core/StarSectorArray2D.hpp index 870881f..1dd88a1 100644 --- a/source/core/StarSectorArray2D.hpp +++ b/source/core/StarSectorArray2D.hpp @@ -235,7 +235,7 @@ typename SectorArray2D<ElementT, SectorSize>::ArrayPtr SectorArray2D<ElementT, S ArrayPtr ret; m_loadedSectors.remove(id); std::swap(m_sectors(id[0], id[1]), ret); - return std::move(ret); + return ret; } template <typename ElementT, size_t SectorSize> diff --git a/source/game/StarInput.cpp b/source/game/StarInput.cpp index 8dcf8e9..3a2fa9f 100644 --- a/source/game/StarInput.cpp +++ b/source/game/StarInput.cpp @@ -172,7 +172,7 @@ Json Input::bindToJson(Bind const& bind) { }; // don't want empty mods to exist as null entry if (auto mods = keyModsToJson(keyBind->mods)) obj.emplace("mods", std::move(mods)); - return std::move(obj); + return obj; } else if (auto mouseBind = bind.ptr<MouseBind>()) { auto obj = JsonObject{ @@ -181,7 +181,7 @@ Json Input::bindToJson(Bind const& bind) { }; if (auto mods = keyModsToJson(mouseBind->mods)) obj.emplace("mods", std::move(mods)); - return std::move(obj); + return obj; } else if (auto controllerBind = bind.ptr<ControllerBind>()) { return JsonObject{ @@ -577,7 +577,7 @@ Json Input::getDefaultBinds(String const& categoryId, String const& bindId) { for (Bind const& bind : bindEntry(categoryId, bindId).defaultBinds) array.emplace_back(bindToJson(bind)); - return std::move(array); + return array; } Json Input::getBinds(String const& categoryId, String const& bindId) { @@ -585,7 +585,7 @@ Json Input::getBinds(String const& categoryId, String const& bindId) { for (Bind const& bind : bindEntry(categoryId, bindId).customBinds) array.emplace_back(bindToJson(bind)); - return std::move(array); + return array; } void Input::setBinds(String const& categoryId, String const& bindId, Json const& jBinds) { diff --git a/source/game/scripting/StarInputLuaBindings.cpp b/source/game/scripting/StarInputLuaBindings.cpp index 9d710d4..9a99c4a 100644 --- a/source/game/scripting/StarInputLuaBindings.cpp +++ b/source/game/scripting/StarInputLuaBindings.cpp @@ -49,7 +49,7 @@ LuaCallbacks LuaBindings::makeInputCallbacks() { result.emplace_back(jEvent.set("processed", pair.second)); } - return std::move(result); + return result; }); callbacks.registerCallbackWithSignature<Vec2I>("mousePosition", bind(mem_fn(&Input::mousePosition), input)); |