Skip to content

Commit

Permalink
used moves on return
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Aug 1, 2022
1 parent 1cae9de commit e0ae463
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/orm/tiny/tinybuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ namespace Orm::Tiny

// Found
if (model)
return *model;
return std::move(*model);

return newModelInstance();
}
Expand All @@ -443,7 +443,7 @@ namespace Orm::Tiny

// Found
if (model)
return *model;
return std::move(*model);

throw Exceptions::ModelNotFoundError(
TypeUtils::classPureBasename<Model>(), {id});
Expand Down Expand Up @@ -534,7 +534,7 @@ namespace Orm::Tiny

// Model found in db
if (instance)
return *instance;
return std::move(*instance);

return newModelInstance(AttributeUtils::joinAttributesForFirstOr(
attributes, values, m_model.getKeyName()));
Expand All @@ -547,7 +547,7 @@ namespace Orm::Tiny
{
// Model found in db
if (auto instance = this->where(attributes).first(); instance)
return *instance;
return std::move(*instance);

return Helpers::tap<Model>(
newModelInstance(AttributeUtils::joinAttributesForFirstOr(
Expand All @@ -565,7 +565,7 @@ namespace Orm::Tiny

// Found
if (model)
return *model;
return std::move(*model);

throw Exceptions::ModelNotFoundError(TypeUtils::classPureBasename<Model>());
}
Expand Down

0 comments on commit e0ae463

Please sign in to comment.