Skip to content

Commit d637744

Browse files
Update analyze_cache.py: agree with the type checker and remove code that can never be gotten
1 parent 4cd85ab commit d637744

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

misc/analyze_cache.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ def extract(chunks: Iterable[JsonDict]) -> Iterable[JsonDict]:
4141
if isinstance(chunk, dict):
4242
yield chunk
4343
yield from extract(chunk.values())
44-
elif isinstance(chunk, list):
45-
yield from extract(chunk)
4644

4745
yield from extract([chunk.data for chunk in chunks])
4846

@@ -92,8 +90,6 @@ def compress(chunk: JsonDict) -> JsonDict:
9290

9391
def helper(chunk: JsonDict) -> JsonDict:
9492
nonlocal counter
95-
if not isinstance(chunk, dict):
96-
return chunk
9793

9894
if len(chunk) <= 2:
9995
return chunk
@@ -123,8 +119,6 @@ def decompress(chunk: JsonDict) -> JsonDict:
123119
cache: dict[int, JsonDict] = {}
124120

125121
def helper(chunk: JsonDict) -> JsonDict:
126-
if not isinstance(chunk, dict):
127-
return chunk
128122
if ".id" in chunk:
129123
return cache[chunk[".id"]]
130124

0 commit comments

Comments
 (0)