|
|
@@ -17,22 +17,22 @@ var MinMaxAccumulator = module.exports = function MinMaxAccumulator(theSense){
|
|
|
var Value = require("../Value");
|
|
|
|
|
|
proto.processInternal = function processInternal(input, merging) {
|
|
|
- // nullish values should have no impact on result
|
|
|
- if (!(input === undefined || input === null)) {
|
|
|
- // compare with the current value; swap if appropriate
|
|
|
- var cmp = Value.compare(this._val, input) * this._sense;
|
|
|
- if (cmp > 0 || this._val === undefined) { // missing is lower than all other values
|
|
|
- this._val = input;
|
|
|
- }
|
|
|
- }
|
|
|
+ // nullish values should have no impact on result
|
|
|
+ if (!(input === undefined || input === null)) {
|
|
|
+ // compare with the current value; swap if appropriate
|
|
|
+ var cmp = Value.compare(this._val, input) * this._sense;
|
|
|
+ if (cmp > 0 || this._val === undefined) { // missing is lower than all other values
|
|
|
+ this._val = input;
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
proto.getValue = function getValue(toBeMerged) {
|
|
|
- return this._val;
|
|
|
+ return this._val;
|
|
|
};
|
|
|
|
|
|
proto.reset = function reset() {
|
|
|
- this._val = undefined;
|
|
|
+ this._val = undefined;
|
|
|
};
|
|
|
|
|
|
klass.createMin = function createMin(){
|
|
|
@@ -44,7 +44,6 @@ klass.createMax = function createMax(){
|
|
|
};
|
|
|
|
|
|
proto.getOpName = function getOpName() {
|
|
|
- if (this._sense == 1)
|
|
|
- return "$min";
|
|
|
- return "$max";
|
|
|
+ if (this._sense == 1) return "$min";
|
|
|
+ return "$max";
|
|
|
};
|