Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use !isOpen() and bail out early in all methods
There were different ways of checking the state of the db before actually doing something: 1. Check if open and do something, else bail if (isOpen()) { // Do stuff } else { // Bail } 2. Check if closed and bail, else do something if (isClosed()) { // Bail } // Do stuff I chose number 2 for all methods, but replaced isClosed() with !isOpen(). The reasons for this are: - Consistency - Get rid of a level of indentation - No longer internally dependent of the isClosed() method -> Easier to remove if we so choose.
- Loading branch information
Lars-Magnus Skog
committed
Feb 18, 2013
1 parent
0905aee
commit 6f248ca
Showing
1 changed file
with
59 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cosmetic change. Should have same indentation as the parameters to the
readStream.create()
call inLevelUP.prototype.readStream()