mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Optimize _.matches.
This commit is contained in:
@@ -8207,12 +8207,12 @@
|
|||||||
// property containing a primitive value
|
// property containing a primitive value
|
||||||
if (propsLength == 1 && value === value && !isObject(value)) {
|
if (propsLength == 1 && value === value && !isObject(value)) {
|
||||||
return function(object) {
|
return function(object) {
|
||||||
if (!(object && hasOwnProperty.call(object, key))) {
|
if (object == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// treat `-0` vs. `+0` as not equal
|
// treat `-0` vs. `+0` as not equal
|
||||||
var other = object[key];
|
var other = object[key];
|
||||||
return value === other && (value !== 0 || (1 / value == 1 / other));
|
return value === other && (value !== 0 || (1 / value == 1 / other)) && hasOwnProperty.call(object, key);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return function(object) {
|
return function(object) {
|
||||||
|
|||||||
Reference in New Issue
Block a user