mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Remove checks for the Map existence (#4091)
This commit is contained in:
committed by
John-David Dalton
parent
377e2d87c8
commit
3b199c30e0
@@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
import Hash from './Hash.js'
|
import Hash from './Hash.js'
|
||||||
import ListCache from './ListCache.js'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the data for `map`.
|
* Gets the data for `map`.
|
||||||
@@ -60,7 +59,7 @@ class MapCache {
|
|||||||
this.size = 0
|
this.size = 0
|
||||||
this.__data__ = {
|
this.__data__ = {
|
||||||
'hash': new Hash,
|
'hash': new Hash,
|
||||||
'map': new (Map || ListCache),
|
'map': new Map,
|
||||||
'string': new Hash
|
'string': new Hash
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class Stack {
|
|||||||
let data = this.__data__
|
let data = this.__data__
|
||||||
if (data instanceof ListCache) {
|
if (data instanceof ListCache) {
|
||||||
const pairs = data.__data__
|
const pairs = data.__data__
|
||||||
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
if (pairs.length < LARGE_ARRAY_SIZE - 1) {
|
||||||
pairs.push([key, value])
|
pairs.push([key, value])
|
||||||
this.size = ++data.size
|
this.size = ++data.size
|
||||||
return this
|
return this
|
||||||
|
|||||||
Reference in New Issue
Block a user