From 030910594884a6108ac6951b548fb08cc9c91533 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 15 Oct 2012 03:13:51 -0700 Subject: [PATCH] Cleanup --- src/HashedObject.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/HashedObject.cpp b/src/HashedObject.cpp index ca0becbef..41126fd1a 100644 --- a/src/HashedObject.cpp +++ b/src/HashedObject.cpp @@ -52,8 +52,10 @@ bool HashedObjectStore::store(HashedObjectType type, uint32 index, void HashedObjectStore::bulkWrite() { + std::vector< boost::shared_ptr > set; + while (1) { - std::vector< boost::shared_ptr > set; + set.clear(); set.reserve(128); { @@ -65,6 +67,7 @@ void HashedObjectStore::bulkWrite() return; } } + cLog(lsINFO) << "HOS: writing " << set.size(); static boost::format fExists("SELECT ObjType FROM CommittedObjects WHERE Hash = '%s';"); static boost::format @@ -95,7 +98,7 @@ void HashedObjectStore::bulkWrite() } db->executeSQL("END TRANSACTION;"); - } while(1); + } } HashedObject::pointer HashedObjectStore::retrieve(const uint256& hash)