Skip to content

Commit 6bffba7

Browse files
committed
chore: remove caching on [CD]Parameter.bounds
1 parent bac0bf9 commit 6bffba7

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

src/_c/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from collections import namedtuple
22
from enum import IntEnum
3-
from functools import lru_cache
43

54
from ._zstd import (
65
EndlessZstdDecompressor,
@@ -145,7 +144,6 @@ class CParameter(IntEnum):
145144
jobSize = _ZSTD_c_jobSize
146145
overlapLog = _ZSTD_c_overlapLog
147146

148-
@lru_cache(maxsize=None)
149147
def bounds(self):
150148
"""Return lower and upper bounds of a compression parameter, both inclusive."""
151149
# 1 means compression parameter
@@ -157,7 +155,6 @@ class DParameter(IntEnum):
157155

158156
windowLogMax = _ZSTD_d_windowLogMax
159157

160-
@lru_cache(maxsize=None)
161158
def bounds(self):
162159
"""Return lower and upper bounds of a decompression parameter, both inclusive."""
163160
# 0 means decompression parameter

src/_cffi/common.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import sys
22
from collections import namedtuple
33
from enum import IntEnum
4-
from functools import lru_cache
54

65
from ._cffi_zstd import ffi, lib as m
76

@@ -87,7 +86,6 @@ class CParameter(IntEnum):
8786
jobSize = m.ZSTD_c_jobSize
8887
overlapLog = m.ZSTD_c_overlapLog
8988

90-
@lru_cache(maxsize=None)
9189
def bounds(self):
9290
"""Return lower and upper bounds of a compression parameter, both inclusive."""
9391
# 1 means compression parameter
@@ -98,7 +96,6 @@ class DParameter(IntEnum):
9896

9997
windowLogMax = m.ZSTD_d_windowLogMax
10098

101-
@lru_cache(maxsize=None)
10299
def bounds(self):
103100
"""Return lower and upper bounds of a decompression parameter, both inclusive."""
104101
# 0 means decompression parameter

tests/test_zstd.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,19 +1297,6 @@ def test_decompress_empty_content_frame(self):
12971297
self.assertFalse(d.at_frame_edge)
12981298
self.assertTrue(d.needs_input)
12991299

1300-
def test_parameter_bounds_cache(self):
1301-
a = CParameter.compressionLevel.bounds()
1302-
b = CParameter.compressionLevel.bounds()
1303-
self.assertIs(a, b)
1304-
1305-
a = CParameter.windowLog.bounds()
1306-
b = CParameter.windowLog.bounds()
1307-
self.assertIs(a, b)
1308-
1309-
a = DParameter.windowLogMax.bounds()
1310-
b = DParameter.windowLogMax.bounds()
1311-
self.assertIs(a, b)
1312-
13131300
class DecompressorFlagsTestCase(unittest.TestCase):
13141301

13151302
@classmethod

0 commit comments

Comments
 (0)