Remove confusing conditions (#1159)

* Remove unreachable code

* Remove redundant condition

Every path with `!this.values` results in `false` regardless of `this.binary`.
This commit is contained in:
Charmander 2016-12-13 05:50:07 -08:00 committed by Brian C
parent 48a9738a0b
commit 981960b445
2 changed files with 2 additions and 7 deletions

View File

@ -65,11 +65,9 @@ Query.prototype.requiresPreparation = function() {
if(this.rows) { return true; }
//don't prepare empty text queries
if(!this.text) { return false; }
//binary should be prepared to specify results should be in binary
//unless there are no parameters
if(this.binary && !this.values) { return false; }
//prepare if there are values
return (this.values || 0).length > 0;
if(!this.values) { return false; }
return this.values.length > 0;
};

View File

@ -64,9 +64,6 @@ var prepareValue = function(val, seen) {
if(typeof val === 'object') {
return prepareObject(val, seen);
}
if (typeof val === 'undefined') {
throw new Error('SQL queries with undefined where clause option');
}
return val.toString();
};