FROMLIST: rust: rbtree: add `RBTree::entry`
This mirrors the entry API [1] from the Rust standard library on `RBTree`. This API can be used to access the entry at a specific key and make modifications depending on whether the key is vacant or occupied. This API is useful because it can often be used to avoid traversing the tree multiple times. This is used by binder to look up and conditionally access or insert a value, depending on whether it is there or not [2]. Link: https://doc.rust-lang.org/stable/std/collections/btree_map/enum.Entry.html [1] Link: https://android-review.googlesource.com/c/kernel/common/+/2849906 [2] Signed-off-by:Alice Ryhl <aliceryhl@google.com> Signed-off-by:
Matt Gilbride <mattgilbride@google.com> Bug: 324206405 Link: https://lore.kernel.org/all/20240205-b4-rbtree-v1-6-995e3eee38c0@google.com/ Change-Id: Ibac5053555469ee2e1312b00197b3821e5e98d76 Signed-off-by:
Alice Ryhl <aliceryhl@google.com>
Loading
Please sign in to comment