From afd4ce3a5e41176a2bb704d46ea681dd4073410c Mon Sep 17 00:00:00 2001 From: Miki Rozloznik Date: Thu, 30 May 2024 19:26:18 +0800 Subject: [PATCH] add std::move --- .../extensions/cpp/runtime/src/zserio/Reflectable.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/extensions/cpp/runtime/src/zserio/Reflectable.h b/compiler/extensions/cpp/runtime/src/zserio/Reflectable.h index b23dde97d..e31494f47 100644 --- a/compiler/extensions/cpp/runtime/src/zserio/Reflectable.h +++ b/compiler/extensions/cpp/runtime/src/zserio/Reflectable.h @@ -1960,19 +1960,19 @@ IBasicReflectableConstPtr getFromObject( auto field = getFieldFromObject(object, name); if (field) { - return isLast ? field : getFromObject(*field, path, dotPos + 1); + return isLast ? std::move(field) : getFromObject(*field, path, dotPos + 1); } auto parameter = getParameterFromObject(object, name); if (parameter) { - return isLast ? parameter : getFromObject(*parameter, path, dotPos + 1); + return isLast ? std::move(parameter) : getFromObject(*parameter, path, dotPos + 1); } auto functionResult = callFunctionInObject(object, name); if (functionResult) { - return isLast ? functionResult : getFromObject(*functionResult, path, dotPos + 1); + return isLast ? std::move(functionResult) : getFromObject(*functionResult, path, dotPos + 1); } } catch (const CppRuntimeException&) @@ -1993,19 +1993,19 @@ IBasicReflectablePtr getFromObject(IBasicReflectable& object, Stri auto field = getFieldFromObject(object, name); if (field) { - return isLast ? field : getFromObject(*field, path, dotPos + 1); + return isLast ? std::move(field) : getFromObject(*field, path, dotPos + 1); } auto parameter = getParameterFromObject(object, name); if (parameter) { - return isLast ? parameter : getFromObject(*parameter, path, dotPos + 1); + return isLast ? std::move(parameter) : getFromObject(*parameter, path, dotPos + 1); } auto functionResult = callFunctionInObject(object, name); if (functionResult) { - return isLast ? functionResult : getFromObject(*functionResult, path, dotPos + 1); + return isLast ? std::move(functionResult) : getFromObject(*functionResult, path, dotPos + 1); } } catch (const CppRuntimeException&)