Skip to content

Commit 0cc199f

Browse files
committed
One more conversion to block drain
1 parent fb1edb7 commit 0cc199f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

opencog/persist/proxy/WriteBufferProxy.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,11 @@ void WriteBufferProxy::postRemoveAtom(AtomSpace* as, const Handle& h,
163163
// might forget, so we do it for them.
164164
if (not _value_queue.is_empty())
165165
{
166-
std::pair<Handle, Handle> pr;
167-
while (_value_queue.try_get(pr))
168-
WriteThruProxy::storeValue(pr.first, pr.second);
166+
size_t bufsz = _value_queue.size();
167+
std::vector<std::pair<Handle, Handle>> vav =
168+
_value_queue.try_get(bufsz);
169+
for (const std::pair<Handle, Handle>& kvp : vav)
170+
WriteThruProxy::storeValue(kvp.first, kvp.second);
169171

170172
WriteThruProxy::barrier();
171173
}

0 commit comments

Comments
 (0)