mirror of
https://github.com/zrwusa/data-structure-typed.git
synced 2024-11-23 04:44:04 +00:00
style: optimization of code style of HashMap
This commit is contained in:
parent
986e7cfd8f
commit
bf37a4df7f
|
@ -34,12 +34,8 @@ export class HashMap<K = any, V = any, R = [K, V]> extends IterableEntryBase<K,
|
|||
super();
|
||||
if (options) {
|
||||
const { hashFn, toEntryFn } = options;
|
||||
if (hashFn) {
|
||||
this._hashFn = hashFn;
|
||||
}
|
||||
if (toEntryFn) {
|
||||
this._toEntryFn = toEntryFn;
|
||||
}
|
||||
if (hashFn) this._hashFn = hashFn;
|
||||
if (toEntryFn) this._toEntryFn = toEntryFn;
|
||||
}
|
||||
if (entryOrRawElements) {
|
||||
this.setMany(entryOrRawElements);
|
||||
|
|
Loading…
Reference in a new issue