Avoid unnecessary copy-initialization

These are copy-constructed from a const reference but are only used as
const reference; make them a const reference.

Change-Id: Id193905b65224c2db4aab88999a92e60d3af3fdf
This commit is contained in:
Miklos Vajna 2018-04-17 09:13:45 +02:00
parent dfab8731a9
commit cb761748ed
2 changed files with 3 additions and 3 deletions

View file

@ -154,7 +154,7 @@ namespace LOKitHelper
std::string partinfo(ptrValue);
std::free(ptrValue);
const auto aPartInfo = Util::JsonToMap(partinfo);
for (const auto prop: aPartInfo)
for (const auto& prop: aPartInfo)
{
const std::string& name = prop.first;
if (name == "visible")

View file

@ -601,8 +601,8 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco::
// Keep only the origin, reject everything else
Poco::URI uriFrameAncestor(frameAncestor);
std::string frameAncestorScheme = uriFrameAncestor.getScheme();
std::string frameAncestorHost = uriFrameAncestor.getHost();
const std::string& frameAncestorScheme = uriFrameAncestor.getScheme();
const std::string& frameAncestorHost = uriFrameAncestor.getHost();
if (!frameAncestor.empty() && Util::isValidURIScheme(frameAncestorScheme) && Util::isValidURIHost(frameAncestorHost))
{