[Libreoffice-commits] online.git: kit/KitHelper.hpp wsd/FileServer.cpp
Miklos Vajna
vmiklos at collabora.co.uk
Tue Apr 17 07:14:42 UTC 2018
kit/KitHelper.hpp | 2 +-
wsd/FileServer.cpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit cb761748ed790b79b717c41949c1da3cc5b25563
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Apr 17 09:13:45 2018 +0200
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
diff --git a/kit/KitHelper.hpp b/kit/KitHelper.hpp
index bc4e2350e..3021f2534 100644
--- a/kit/KitHelper.hpp
+++ b/kit/KitHelper.hpp
@@ -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")
diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index f45a4d852..24ab20b01 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -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))
{
More information about the Libreoffice-commits
mailing list