Chris00 / ocaml-rope

Ropes ("heavyweight strings") for OCaml
Other
49 stars 3 forks source link

Unused `path` record field in Rope.Iterator #7

Open Simn opened 5 years ago

Simn commented 5 years ago
    mutable path: (rope * int) list;
    (* path to the current leaf with global range.  First elements are
       closer to the leaf, last element is the full rope. *)

This is assigned to in make:

path = [(r, 0)]; (* the whole rope *)

However, it is never read, so at the moment it just wastes some memory. I'm assuming the idea was to utilize this in set_current_for_index_rec to have more of a bottom-up approach for finding the new leaf. I'm also assuming that this turned out to not be worth it, so the field should probably just be removed.