@@ -17,7 +17,7 @@ import {
17
17
import { AccountMap } from '../collections/custom-key-map'
18
18
import { MAX_BOX_SIZE } from '../constants'
19
19
import { lazyContext } from '../context-helpers/internal-context'
20
- import { GenericTypeInfo , getEncoder } from '../encoders'
20
+ import { getEncoder , TypeInfo } from '../encoders'
21
21
import { getGenericTypeInfo } from '../runtime-helpers'
22
22
import { asBytes , asBytesCls , asNumber , asUint8Array , conactUint8Arrays , toBytes } from '../util'
23
23
@@ -131,7 +131,7 @@ export class BoxCls<TValue> {
131
131
132
132
private get fromBytes ( ) {
133
133
const typeInfo = getGenericTypeInfo ( this )
134
- const valueType = ( typeInfo ! . genericArgs ! as GenericTypeInfo [ ] ) [ 0 ]
134
+ const valueType = ( typeInfo ! . genericArgs ! as TypeInfo [ ] ) [ 0 ]
135
135
return ( val : Uint8Array ) => getEncoder < TValue > ( valueType ) ( val , valueType )
136
136
}
137
137
@@ -199,7 +199,7 @@ export class BoxMapCls<TKey, TValue> {
199
199
200
200
private get fromBytes ( ) {
201
201
const typeInfo = getGenericTypeInfo ( this )
202
- const valueType = ( typeInfo ! . genericArgs ! as GenericTypeInfo [ ] ) [ 1 ]
202
+ const valueType = ( typeInfo ! . genericArgs ! as TypeInfo [ ] ) [ 1 ]
203
203
return ( val : Uint8Array ) => getEncoder < TValue > ( valueType ) ( val , valueType )
204
204
}
205
205
@@ -320,7 +320,7 @@ export class BoxRefCls {
320
320
if ( this . exists ) {
321
321
return false
322
322
}
323
- this . backingValue = new Uint8Array ( Array ( size ) . fill ( 0 ) )
323
+ this . backingValue = new Uint8Array ( size )
324
324
return true
325
325
}
326
326
@@ -354,7 +354,7 @@ export class BoxRefCls {
354
354
if ( updatedContent . length > content . length ) {
355
355
updatedContent = updatedContent . slice ( 0 , content . length )
356
356
} else if ( updatedContent . length < content . length ) {
357
- updatedContent = conactUint8Arrays ( updatedContent , new Uint8Array ( Array ( content . length - updatedContent . length ) . fill ( 0 ) ) )
357
+ updatedContent = conactUint8Arrays ( updatedContent , new Uint8Array ( content . length - updatedContent . length ) )
358
358
}
359
359
this . backingValue = updatedContent
360
360
}
@@ -404,7 +404,7 @@ export class BoxRefCls {
404
404
}
405
405
let updatedContent
406
406
if ( newSizeNumber > content . length ) {
407
- updatedContent = conactUint8Arrays ( content , new Uint8Array ( Array ( newSizeNumber - content . length ) . fill ( 0 ) ) )
407
+ updatedContent = conactUint8Arrays ( content , new Uint8Array ( newSizeNumber - content . length ) )
408
408
} else {
409
409
updatedContent = content . slice ( 0 , newSize )
410
410
}
0 commit comments