Don't use std::move when returning a local variable, allow NRVO

This commit is contained in:
Dan Paulat 2022-10-08 00:03:47 -05:00
parent d73c1597d2
commit 976617d342
2 changed files with 4 additions and 4 deletions

View file

@ -157,7 +157,7 @@ std::vector<std::shared_ptr<RadarSite>> RadarSite::GetAll()
radarSites.push_back(site.second); radarSites.push_back(site.second);
} }
return std::move(radarSites); return radarSites;
} }
std::string GetRadarIdFromSiteId(const std::string& siteId) std::string GetRadarIdFromSiteId(const std::string& siteId)

View file

@ -260,7 +260,7 @@ TextureAtlas::Impl::LoadImage(const std::string& imagePath)
if (!imageFile.isOpen()) if (!imageFile.isOpen())
{ {
logger_->error("Could not open image: {}", imagePath); logger_->error("Could not open image: {}", imagePath);
return std::move(image); return image;
} }
boost::iostreams::stream<util::IoDeviceSource> dataStream(imageFile); boost::iostreams::stream<util::IoDeviceSource> dataStream(imageFile);
@ -275,10 +275,10 @@ TextureAtlas::Impl::LoadImage(const std::string& imagePath)
catch (const std::exception& ex) catch (const std::exception& ex)
{ {
logger_->error("Error reading image: {}", ex.what()); logger_->error("Error reading image: {}", ex.what());
return std::move(image); return image;
} }
return std::move(image); return image;
} }
TextureAtlas& TextureAtlas::Instance() TextureAtlas& TextureAtlas::Instance()