Skip to content

Commit f37dcf2

Browse files
Update libcachesim/synthetic_reader.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent c7ed0a1 commit f37dcf2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcachesim/synthetic_reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ def get_read_pos(self) -> float:
185185
def get_working_set_size(self) -> Tuple[int, int]:
186186
"""Calculate working set size"""
187187
wss_obj, wss_byte = 0, 0
188-
if self._obj_ids is not None:
189-
unique_ids = np.unique(self._obj_ids[:self.current_pos])
188+
if self.current_pos > 0:
189+
unique_ids = np.unique(self.obj_ids[:self.current_pos])
190190
wss_obj = len(unique_ids)
191191
wss_byte = wss_obj * self.obj_size
192192
return wss_obj, wss_byte

0 commit comments

Comments
 (0)