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:
parent
48a9738a0b
commit
981960b445
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user