diff OrthancServer/ServerIndex.cpp @ 1241:90d2f320862d

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 05 Dec 2014 17:22:53 +0100
parents 62c35e4b67db
children a0e420c5f2b8
line wrap: on
line diff
--- a/OrthancServer/ServerIndex.cpp	Fri Dec 05 17:12:35 2014 +0100
+++ b/OrthancServer/ServerIndex.cpp	Fri Dec 05 17:22:53 2014 +0100
@@ -1022,8 +1022,19 @@
   void ServerIndex::GetAllUuids(Json::Value& target,
                                 ResourceType resourceType)
   {
-    boost::mutex::scoped_lock lock(mutex_);
-    db_->GetAllPublicIds(target, resourceType);
+    std::list<std::string> lst;
+
+    {
+      boost::mutex::scoped_lock lock(mutex_);
+      db_->GetAllPublicIds(lst, resourceType);
+    }
+
+    target = Json::arrayValue;
+    for (std::list<std::string>::const_iterator
+           it = lst.begin(); it != lst.end(); it++)
+    {
+      target.append(*it);
+    }
   }