[varStore] Another bugfix in optimize()

This commit is contained in:
Behdad Esfahbod 2023-05-24 13:00:59 -06:00
parent e4281b07bc
commit 0677c0e705
2 changed files with 15 additions and 0 deletions

View File

@ -422,6 +422,8 @@ class _Encoding(object):
else: else:
new_encoding = None new_encoding = None
self.best_new_encoding = new_encoding self.best_new_encoding = new_encoding
if new_encoding:
break
class _EncodingDict(dict): class _EncodingDict(dict):

View File

@ -108,6 +108,19 @@ def buildAxis(axisTag):
2, 2,
186, 186,
), ),
(
5,
[
[10, 11, 0, 0, 20],
[10, 300, 0, 0, 20],
[10, 301, 0, 0, 20],
[10, 302, 0, 0, 20],
[10, 303, 0, 0, 20],
[10, 304, 0, 0, 20],
],
1,
180,
),
], ],
) )
def test_optimize(numRegions, varData, expectedNumVarData, expectedBytes): def test_optimize(numRegions, varData, expectedNumVarData, expectedBytes):