Skip to content

Commit

Permalink
Anal jshint adjustments.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikermcneil committed Mar 21, 2013
1 parent 5989bd0 commit 7c6d0e1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/dirty/dirty.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = Dirty;

Dirty.prototype.set = function(key, val, cb) {
if (val === undefined) {
this._keys.splice(this._keys.indexOf(key), 1)
this._keys.splice(this._keys.indexOf(key), 1);
delete this._docs[key];
} else {
if (this._keys.indexOf(key) === -1) {
Expand Down Expand Up @@ -100,10 +100,12 @@ Dirty.prototype._load = function() {
arr.forEach(function(rowStr) {
if (!rowStr) {
self.emit('error', new Error('Empty lines never appear in a healthy database'));
return
return;
}

var row;
try {
var row = JSON.parse(rowStr);
row = JSON.parse(rowStr);
if (!('key' in row)) {
throw new Error();
}
Expand Down Expand Up @@ -152,7 +154,7 @@ Dirty.prototype._writeDrain = function() {
} else {
this._maybeFlush();
}
}
};

Dirty.prototype._maybeFlush = function() {
if (this.flushing || !this._queue.length) {
Expand Down

0 comments on commit 7c6d0e1

Please sign in to comment.