Skip to content

Commit

Permalink
add std::move
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed May 30, 2024
1 parent dee9448 commit afd4ce3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions compiler/extensions/cpp/runtime/src/zserio/Reflectable.h
Original file line number Diff line number Diff line change
Expand Up @@ -1960,19 +1960,19 @@ IBasicReflectableConstPtr<ALLOC> 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&)
Expand All @@ -1993,19 +1993,19 @@ IBasicReflectablePtr<ALLOC> getFromObject(IBasicReflectable<ALLOC>& 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&)
Expand Down

0 comments on commit afd4ce3

Please sign in to comment.