Use Array#splice directly.

This commit is contained in:
John-David Dalton
2017-04-19 12:18:37 -07:00
parent 65b148a3b2
commit 08a3f533b7
3 changed files with 4 additions and 13 deletions

View File

@@ -1,9 +1,6 @@
import baseUnset from './baseUnset.js'
import isIndex from './isIndex.js'
/** Built-in value references. */
const splice = Array.prototype.splice
/**
* The base implementation of `pullAt` without support for individual
* indexes or capturing the removed elements.
@@ -23,7 +20,7 @@ function basePullAt(array, indexes) {
if (length == lastIndex || index !== previous) {
previous = index
if (isIndex(index)) {
splice.call(array, index, 1)
array.splice(index, 1)
} else {
baseUnset(array, index)
}