File tree Expand file tree Collapse file tree
duva/src/domains/caches/cache_objects/types Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -517,25 +517,14 @@ impl QuickList {
517517 }
518518
519519 let mut current_index = 0 ;
520-
521- // Iterate through nodes to find the requested index
522520 for node in & mut self . nodes {
523- let node_len = node. entry_count ;
524- if current_index + node_len <= index {
525- // This node is before our index, skip it
526- current_index += node_len;
527- continue ;
528- }
529-
530- // Decompress the node and read its entries
531- node. ensure_decompressed ( & self . fill_factor ) ;
532- if let NodeData :: Uncompressed ( ziplist) = & node. data {
533- let entries = ziplist. to_vec ( ) ;
534- if let Some ( entry) = entries. get ( index - current_index) {
535- return Some ( entry. clone ( ) ) ;
521+ if current_index + node. entry_count > index {
522+ node. ensure_decompressed ( & self . fill_factor ) ;
523+ if let NodeData :: Uncompressed ( ziplist) = & node. data {
524+ return ziplist. to_vec ( ) . get ( index - current_index) . cloned ( ) ;
536525 }
537526 }
538- break ; // No need to check further nodes
527+ current_index += node . entry_count ;
539528 }
540529 None
541530 }
You can’t perform that action at this time.
0 commit comments