Skip to content

Commit 9d1616c

Browse files
committed
perf: optimize callback
1 parent 99bd938 commit 9d1616c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/DeepCompositeSymbol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { isObject } from './helpers';
44
// tslint:disable-next-line: variable-name
55
const DeepCompositeSymbol: typeof Tuple.symbol = ((object: any) => {
66
const entries = Object.entries(object);
7-
// Recursively replace non-tuple object values with
7+
// Recursively replace non-tuple object values with tuples
88
entries.forEach(update);
99
return Tuple.unsafeSymbol(...Array.prototype.concat.apply([], entries));
1010
}) as any;

src/Tuple.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ export default class Tuple<A> extends (Array as any) implements ArrayLike<A>, It
125125
}
126126

127127
static unsafeSymbol(...values: any[]): any {
128-
return getDefaultLazy(symbolKey, () => Symbol(), getUnsafeLeaf(values));
128+
return getDefaultLazy(symbolKey, Symbol, getUnsafeLeaf(values));
129129
}
130130

131131
[Symbol.iterator](): IterableIterator<A> {
132132
return arraylikeToIterable(this);
133133
}
134134
}
135135

136-
// Cache keys for each tuple type
136+
// Root cache keys for each tuple type
137137
const tupleKey = Symbol();
138138
const symbolKey = Symbol();
139139

0 commit comments

Comments
 (0)