Files
linux/rust/kernel
Alice Ryhl fbcd4b7bf5 rust: rbtree: add RBTree::is_empty
In Rust Binder I need to be able to determine whether a red/black tree
is empty. Thus, add a method for that operation to replace

	rbtree.iter().next().is_none()

This is terrible, so add a method for this purpose. We do not add a
RBTree::len method because computing the number of elements requires
iterating the entire tree, but checking whether it is empty can be done
cheaply.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Link: https://lore.kernel.org/r/20250616-rbtree-is-empty-v1-1-61f7cfb012e3@google.com
[ Adjusted title. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2025-06-29 18:52:41 +02:00
..
2025-06-22 23:09:32 +02:00
2025-06-22 23:08:42 +02:00
2025-06-22 23:08:42 +02:00
2025-06-22 23:08:42 +02:00
2025-06-22 23:08:42 +02:00
2025-06-22 23:09:17 +02:00
2025-03-16 21:59:19 +01:00
2025-06-22 23:09:17 +02:00
2024-10-08 15:44:36 +02:00
2025-06-22 23:08:42 +02:00
2025-06-29 18:52:41 +02:00
2025-06-22 23:09:32 +02:00
2025-04-29 15:31:07 +02:00
2024-11-04 16:21:44 -05:00