refactor(struct): 10% performance improvement

This commit is contained in:
Simon Chan 2022-05-22 05:23:18 +08:00
parent fa8d251bf2
commit ff708def46
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
9 changed files with 176 additions and 234 deletions

View file

@ -20,6 +20,11 @@ export abstract class StructFieldValue<
/** Gets the associated `Struct` instance */
public readonly struct: StructValue;
public get hasCustomAccessors(): boolean {
return this.get !== StructFieldValue.prototype.get ||
this.set !== StructFieldValue.prototype.set;
}
protected value: TDefinition['TValue'];
public constructor(