23
24
constructor(_defaultValue: T) {
26
>
27
>
this._defaultValue = defaultValue;
28
>
this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue);
29
>
this._map = new Map<number, number>();
30
>
}
31
32
private static _createAsciiMap(defaultValue: number): Uint8Array {
34
>
asciiMap.fill(defaultValue);
35
>
return asciiMap;
36
>
}
37
38
public set(charCode: number, _value: T): void {
40
>
41
>
if (charCode >= 0 && charCode < 256) {
42
>
this._asciiMap[charCode] = value;
43
>
} else {
44
this._map.set(charCode, value);
45
}
47
48
public get(charCode: number): T {