File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -583,12 +583,8 @@ module Make (Inputs : Intf.Inputs.DATABASE) = struct
583583 |> Sequence. iter ~f: (fun i -> f i (get_at_index t i))
584584
585585 let iteri t ~f =
586- match Account_location. last_location_address t with
587- | None ->
588- ()
589- | Some last_addr ->
590- Sequence. range ~stop: `inclusive 0 (Addr. to_int last_addr)
591- |> Sequence. iter ~f: (fun i -> f i (get_at_index_exn t i))
586+ iteri_untrusted t ~f: (fun index account_opt ->
587+ f index (Option. value_exn account_opt) )
592588
593589 (* TODO : if key-value store supports iteration mechanism, like RocksDB,
594590 maybe use that here, instead of loading all accounts into memory See Issue
Original file line number Diff line number Diff line change @@ -917,10 +917,8 @@ module Make (Inputs : Inputs_intf.S) = struct
917917 |> Sequence. iter ~f: (fun i -> f i (get_at_index t i))
918918
919919 let iteri t ~f =
920- assert_is_attached t ;
921- let num_accounts = num_accounts t in
922- Sequence. range ~stop: `exclusive 0 num_accounts
923- |> Sequence. iter ~f: (fun i -> f i (get_at_index_exn t i))
920+ iteri_untrusted t ~f: (fun index account_opt ->
921+ f index (Option. value_exn account_opt) )
924922
925923 let foldi_with_ignored_accounts t ignored_accounts ~init ~f =
926924 assert_is_attached t ;
You can’t perform that action at this time.
0 commit comments