style: optimization of code style of HashMap

This commit is contained in:
zrwusa 2024-09-19 17:20:58 +12:00
parent 986e7cfd8f
commit bf37a4df7f

View file

@ -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);