[Libreoffice-commits] online.git: wsd/AdminModel.cpp

Miklos Vajna vmiklos at collabora.co.uk
Fri Apr 21 11:27:29 UTC 2017


 wsd/AdminModel.cpp |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 9c7cbab615d57ee4aa4538d1bf2d211533407bf3
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Apr 21 13:26:53 2017 +0200

    AdminModel: clean up redundant std::string init
    
    Change-Id: Ia27219d0bf8d1c9787e38a7a287050b8728220d2

diff --git a/wsd/AdminModel.cpp b/wsd/AdminModel.cpp
index e7a2e4ac..1af98871 100644
--- a/wsd/AdminModel.cpp
+++ b/wsd/AdminModel.cpp
@@ -65,7 +65,7 @@ std::pair<std::time_t, std::string> Document::getSnapshot() const
     oss << "\"activeViews\"" << ":" << this->getActiveViews() << ",";
 
     oss << "\"views\"" << ":[";
-    std::string separator = "";
+    std::string separator;
     for (auto view : this->getViews())
     {
         oss << separator << "\"";
@@ -93,7 +93,7 @@ const std::string Document::getHistory() const
     oss << "\"end\"" << ":" << this->_end << ",";
     oss << "\"pid\"" << ":" << this->getPid() << ",";
     oss << "\"snapshots\"" << ":[";
-    std::string separator = "";
+    std::string separator;
     for (auto s : _snapshots)
     {
         oss << separator << s.second;
@@ -186,7 +186,7 @@ std::string AdminModel::getAllHistory() const
 {
     std::ostringstream oss;
     oss << "{ \"documents\" : [";
-    std::string separator1 = "";
+    std::string separator1;
     for (auto d : _documents)
     {
         oss << separator1;
@@ -518,7 +518,7 @@ std::string AdminModel::getDocuments() const
     std::ostringstream oss;
     std::map<std::string, View> viewers;
     oss << '{' << "\"documents\"" << ':' << '[';
-    std::string separator1 = "";
+    std::string separator1;
     for (const auto& it: _documents)
     {
         if (!it.second.isExpired())
@@ -534,7 +534,7 @@ std::string AdminModel::getDocuments() const
                 << "\"idleTime\"" << ':' << it.second.getIdleTime() << ','
                 << "\"views\"" << ':' << '[';
             viewers = it.second.getViews();
-            std::string separator = "";
+            std::string separator;
             for(const auto& viewIt: viewers)
             {
                 if(!viewIt.second.isExpired()) {


More information about the Libreoffice-commits mailing list