File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/librustdoc/html/static/js Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1089,6 +1089,14 @@ class VlqHexDecoder {
10891089class RoaringBitmap {
10901090 /** @param {string } str */
10911091 constructor ( str ) {
1092+ this . keys = [ ] ;
1093+ this . cardinalities = [ ] ;
1094+ this . containers = [ ] ;
1095+
1096+ if ( str === undefined || str === null ) {
1097+ return ;
1098+ }
1099+
10921100 // https://github.com/RoaringBitmap/RoaringFormatSpec
10931101 //
10941102 // Roaring bitmaps are used for flags that can be kept in their
@@ -1113,15 +1121,12 @@ class RoaringBitmap {
11131121 } else {
11141122 is_run = new Uint8Array ( ) ;
11151123 }
1116- this . keys = [ ] ;
1117- this . cardinalities = [ ] ;
11181124 for ( let j = 0 ; j < size ; ++ j ) {
11191125 this . keys . push ( u8array [ i ] | ( u8array [ i + 1 ] << 8 ) ) ;
11201126 i += 2 ;
11211127 this . cardinalities . push ( ( u8array [ i ] | ( u8array [ i + 1 ] << 8 ) ) + 1 ) ;
11221128 i += 2 ;
11231129 }
1124- this . containers = [ ] ;
11251130 let offsets = null ;
11261131 if ( ! has_runs || this . keys . length >= 4 ) {
11271132 offsets = [ ] ;
You can’t perform that action at this time.
0 commit comments