@@ -540,8 +540,8 @@ def runBlockEncode(head, table, tableName=''):
540
540
blockSize = 1 << shift
541
541
print (f'{ head } run block value bit: { totalBit } { valueBit } , length: { len (values )} , size: { minSize } { minSize / 1024 } , block: { len (blockList )} { blockSize } ' )
542
542
543
+ output = []
543
544
if tableName and (len (table ) & (blockSize - 1 )) == 0 :
544
- output = []
545
545
mask = (1 << valueBit ) - 1
546
546
for value in values :
547
547
index = value & mask
@@ -555,7 +555,7 @@ def runBlockEncode(head, table, tableName=''):
555
555
output = []
556
556
blockData = list (itertools .chain .from_iterable (blockList ))
557
557
_dumpRunBlock (output , tableName , values , blockData , valueBit , shift )
558
- return output
558
+ return output
559
559
560
560
def skipBlockEncode (head , table , tableName = '' ):
561
561
itemSize = getItemSize (table )
@@ -590,6 +590,7 @@ def skipBlockEncode(head, table, tableName=''):
590
590
blockSize = 1 << shift
591
591
print (f'{ head } skip block lookup: { length } { length .bit_length ()} , size: { minSize } { minSize / 1024 } , block: { len (blockList )} { blockSize } default: { defaultValue } ' )
592
592
593
+ output = []
593
594
if tableName and defaultBlock and (len (table ) & (blockSize - 1 )) == 0 :
594
595
bitCount = (len (blockList ) - 1 ).bit_length ()
595
596
offsetList = []
@@ -606,11 +607,10 @@ def skipBlockEncode(head, table, tableName=''):
606
607
assert minSize == size , (minSize , size )
607
608
assert output == table
608
609
609
- output = []
610
610
if defaultValue :
611
611
output .append (f'constexpr { _sizeTypeMap [itemSize ]} { tableName } DefaultValue = { defaultValue } ;' )
612
612
_dumpRunBlock (output , tableName , offsetList , blockData , bitCount , shift )
613
- return output
613
+ return output
614
614
615
615
def _compressTableMergedEx (table , itemSize , level ):
616
616
minSize = sys .maxsize
0 commit comments