Closed olebedev closed 6 months ago
Hey, I just got back from a trip so this is good timing, I hadn't even had a chance to look at #24 yet. I promise I'll review this the next few days, but from a quick glance, I'm definitely happier with this than I am with something like insert_before
. Copying (mostly) the Cursor API from the stdlib is a good move.
It might be nice to have a read-only Cursor as well but that's for sure not required for an initial PR.
Hi, I'm very sorry I waited so long on reviewing this, I just got through with a huge cross-country move and I was completely out of commission for more than a month while I moved from Florida to Colorado.
Hi @kyren, I understand you've been busy with your move. No worries at all. Please review the PR when the dust settles and you have a moment.
This looks very good, thanks for being patient will all of my requests!
Just a few minor nits and I think it can be merged.
Looks good now, thank you!
Motivation
Add a feature that enables insert elements in the middle of the underlying linked-list. Initial discussion is in https://github.com/kyren/hashlink/issues/23.
Following further reflection since our initial discussion, I've implemented the
CursorMut
API as outlined in my previous comment. This pull request is intended to supersede #24, which I suggest we close in favor of this updated approach.In this PR
The difference to the Cursor API from the RFC:
index
,splice_*
,split_*
,as_cursor
, andremove_current
have been omitted, as they are either not required for my purposes or are not applicable to the context of aLinkedHashMap
, such as theindex
method.I'm open to discussions about the API design and its implementation. I would appreciate your thoughts on the matter.
Kind regards, Oleg