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 {
1089
1089
class RoaringBitmap {
1090
1090
/** @param {string } str */
1091
1091
constructor ( str ) {
1092
+ this . keys = [ ] ;
1093
+ this . cardinalities = [ ] ;
1094
+ this . containers = [ ] ;
1095
+
1096
+ if ( str === undefined || str === null ) {
1097
+ return ;
1098
+ }
1099
+
1092
1100
// https://github.com/RoaringBitmap/RoaringFormatSpec
1093
1101
//
1094
1102
// Roaring bitmaps are used for flags that can be kept in their
@@ -1113,15 +1121,12 @@ class RoaringBitmap {
1113
1121
} else {
1114
1122
is_run = new Uint8Array ( ) ;
1115
1123
}
1116
- this . keys = [ ] ;
1117
- this . cardinalities = [ ] ;
1118
1124
for ( let j = 0 ; j < size ; ++ j ) {
1119
1125
this . keys . push ( u8array [ i ] | ( u8array [ i + 1 ] << 8 ) ) ;
1120
1126
i += 2 ;
1121
1127
this . cardinalities . push ( ( u8array [ i ] | ( u8array [ i + 1 ] << 8 ) ) + 1 ) ;
1122
1128
i += 2 ;
1123
1129
}
1124
- this . containers = [ ] ;
1125
1130
let offsets = null ;
1126
1131
if ( ! has_runs || this . keys . length >= 4 ) {
1127
1132
offsets = [ ] ;
You can’t perform that action at this time.
0 commit comments