Skip to content

Commit

Permalink
Core: Remove array allocation for innerEquiv
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Aug 16, 2022
1 parent 4944d79 commit dac41dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/core/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Logger from '../logger';

export const toString = Object.prototype.toString;
export const hasOwn = Object.prototype.hasOwnProperty;
export const slice = Array.prototype.slice;

const nativePerf = getNativePerf();

Expand Down
4 changes: 2 additions & 2 deletions src/equiv.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { objectType } from './core/utilities';
import { objectType, slice } from './core/utilities';

// Value pairs queued for comparison. Used for breadth-first processing order, recursion
// detection and avoiding repeated comparison (see below for details).
Expand Down Expand Up @@ -298,7 +298,7 @@ function innerEquiv (a, b) {
}

// ...across all consecutive argument pairs
return arguments.length === 2 || innerEquiv.apply(this, [].slice.call(arguments, 1));
return arguments.length === 2 || innerEquiv.apply(this, slice.call(arguments, 1));
}

export default function equiv (...args) {
Expand Down

0 comments on commit dac41dc

Please sign in to comment.