Skip to content

Commit c2fdff5

Browse files
authored
refactor: delegate values() to _sorted_records() (#19)
Eliminate code duplication by having TableMixin.values() call _sorted_records() instead of reimplementing the same list comprehension logic.
1 parent db493fb commit c2fdff5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/jsonlt/_mixin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ def values(self) -> "list[JSONObject]":
200200
A list of all records, sorted by key.
201201
"""
202202
self._prepare_read()
203-
state = self._get_state()
204-
return [state[k] for k in self._sorted_keys()]
203+
return self._sorted_records()
205204

206205
def items(self) -> "list[tuple[Key, JSONObject]]":
207206
"""Get all key-value pairs in key order.

0 commit comments

Comments
 (0)