Removed some redundant std::move usages in return statements.

This commit is contained in:
Kai Blaschke 2024-02-19 18:39:01 +01:00
parent 431a9c00a5
commit 7c4fbad2ba
No known key found for this signature in database
GPG Key ID: B014B6811527389F
7 changed files with 11 additions and 11 deletions

View File

@ -201,7 +201,7 @@ ImageOperation imageOperationFromString(StringView string) {
else if (!which || (ptr != end && ++ptr != end)) else if (!which || (ptr != end && ++ptr != end))
throw ImageOperationException(strf("Improper size for hex string '{}' in imageOperationFromString", StringView(hexPtr, hexLen)), false); 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. 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; which = !which;

View File

@ -30,7 +30,7 @@ Maybe<Type> maybeLexicalCast(StringView s, std::ios_base::fmtflags flags = std::
if (stream >> ch) if (stream >> ch)
return {}; return {};
return std::move(result); return result;
} }
template <typename Type> template <typename Type>

View File

@ -172,7 +172,7 @@ auto MapMixin<BaseMap>::maybeTake(key_type const& k) -> Maybe<mapped_type> {
if (i != Base::end()) { if (i != Base::end()) {
mapped_type v = std::move(i->second); mapped_type v = std::move(i->second);
Base::erase(i); Base::erase(i);
return std::move(v); return v;
} }
return {}; return {};
@ -198,7 +198,7 @@ template <typename BaseMap>
auto MapMixin<BaseMap>::value(key_type const& k, mapped_type d) const -> mapped_type { auto MapMixin<BaseMap>::value(key_type const& k, mapped_type d) const -> mapped_type {
const_iterator i = Base::find(k); const_iterator i = Base::find(k);
if (i == Base::end()) if (i == Base::end())
return std::move(d); return d;
else else
return i->second; return i->second;
} }

View File

@ -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 OrderedMapWrapper<Map, Key, Value, Allocator, MapArgs...>::value(key_type const& k, mapped_type d) const -> mapped_type {
auto i = m_map.find(k); auto i = m_map.find(k);
if (i == m_map.end()) if (i == m_map.end())
return std::move(d); return d;
else else
return i->second->second; return i->second->second;
} }

View File

@ -235,7 +235,7 @@ typename SectorArray2D<ElementT, SectorSize>::ArrayPtr SectorArray2D<ElementT, S
ArrayPtr ret; ArrayPtr ret;
m_loadedSectors.remove(id); m_loadedSectors.remove(id);
std::swap(m_sectors(id[0], id[1]), ret); std::swap(m_sectors(id[0], id[1]), ret);
return std::move(ret); return ret;
} }
template <typename ElementT, size_t SectorSize> template <typename ElementT, size_t SectorSize>

View File

@ -172,7 +172,7 @@ Json Input::bindToJson(Bind const& bind) {
}; // don't want empty mods to exist as null entry }; // don't want empty mods to exist as null entry
if (auto mods = keyModsToJson(keyBind->mods)) if (auto mods = keyModsToJson(keyBind->mods))
obj.emplace("mods", std::move(mods)); obj.emplace("mods", std::move(mods));
return std::move(obj); return obj;
} }
else if (auto mouseBind = bind.ptr<MouseBind>()) { else if (auto mouseBind = bind.ptr<MouseBind>()) {
auto obj = JsonObject{ auto obj = JsonObject{
@ -181,7 +181,7 @@ Json Input::bindToJson(Bind const& bind) {
}; };
if (auto mods = keyModsToJson(mouseBind->mods)) if (auto mods = keyModsToJson(mouseBind->mods))
obj.emplace("mods", std::move(mods)); obj.emplace("mods", std::move(mods));
return std::move(obj); return obj;
} }
else if (auto controllerBind = bind.ptr<ControllerBind>()) { else if (auto controllerBind = bind.ptr<ControllerBind>()) {
return JsonObject{ return JsonObject{
@ -577,7 +577,7 @@ Json Input::getDefaultBinds(String const& categoryId, String const& bindId) {
for (Bind const& bind : bindEntry(categoryId, bindId).defaultBinds) for (Bind const& bind : bindEntry(categoryId, bindId).defaultBinds)
array.emplace_back(bindToJson(bind)); array.emplace_back(bindToJson(bind));
return std::move(array); return array;
} }
Json Input::getBinds(String const& categoryId, String const& bindId) { 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) for (Bind const& bind : bindEntry(categoryId, bindId).customBinds)
array.emplace_back(bindToJson(bind)); array.emplace_back(bindToJson(bind));
return std::move(array); return array;
} }
void Input::setBinds(String const& categoryId, String const& bindId, Json const& jBinds) { void Input::setBinds(String const& categoryId, String const& bindId, Json const& jBinds) {

View File

@ -49,7 +49,7 @@ LuaCallbacks LuaBindings::makeInputCallbacks() {
result.emplace_back(jEvent.set("processed", pair.second)); result.emplace_back(jEvent.set("processed", pair.second));
} }
return std::move(result); return result;
}); });
callbacks.registerCallbackWithSignature<Vec2I>("mousePosition", bind(mem_fn(&Input::mousePosition), input)); callbacks.registerCallbackWithSignature<Vec2I>("mousePosition", bind(mem_fn(&Input::mousePosition), input));