Skip to content

Commit

Permalink
Merge pull request #49 from mscdex/master
Browse files Browse the repository at this point in the history
use more efficient emptiness checking
  • Loading branch information
rvagg committed Jul 28, 2013
2 parents fce1ffd + c28db65 commit 2569c39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void Database::ReleaseIterator (uint32_t id) {
// if there is a pending CloseWorker it means that we're waiting for
// iterators to end before we can close them
iterators.erase(id);
if (iterators.size() == 0 && pendingCloseWorker != NULL) {
if (iterators.empty() && pendingCloseWorker != NULL) {
AsyncQueueWorker((AsyncWorker*)pendingCloseWorker);
pendingCloseWorker = NULL;
}
Expand Down Expand Up @@ -276,7 +276,7 @@ v8::Handle<v8::Value> Database::Close (const v8::Arguments& args) {
, v8::Persistent<v8::Function>::New(LD_NODE_ISOLATE_PRE callback)
);

if (database->iterators.size() > 0) {
if (!database->iterators.empty()) {
// yikes, we still have iterators open! naughty naughty.
// we have to queue up a CloseWorker and manually close each of them.
// the CloseWorker will be invoked once they are all cleaned up
Expand Down

0 comments on commit 2569c39

Please sign in to comment.