[Libreoffice-commits] online.git: common/Util.cpp

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 14 11:42:13 UTC 2020


 common/Util.cpp |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 61790f6bb55c87b01814a6d4d5dd9247c048145c
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Apr 14 09:54:04 2020 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Apr 14 13:41:55 2020 +0200

    common: it's enough to look up PRETTY_NAME once
    
    Also add the missing newlines before the opening braces, the surrounding
    code has that style.
    
    Change-Id: I23bd26ba6d2446858ae3213212e2813a38fd1d46
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92146
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/common/Util.cpp b/common/Util.cpp
index 703bfdd4b..7b71da598 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -963,10 +963,13 @@ namespace Util
             std::vector<std::string> infoList = Util::splitStringToVector(str, '\n');
             std::map<std::string, std::string> releaseInfo = Util::stringVectorToMap(infoList, '=');
 
-            if (releaseInfo.find("PRETTY_NAME") != releaseInfo.end()) {
-                return releaseInfo["PRETTY_NAME"];
+            auto it = releaseInfo.find("PRETTY_NAME");
+            if (it != releaseInfo.end())
+            {
+                return it->second;
             }
-            else{
+            else
+            {
                 return "unknown";
             }
         }


More information about the Libreoffice-commits mailing list