We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af1e363 commit ca15e9dCopy full SHA for ca15e9d
library/alloc/src/collections/binary_heap.rs
@@ -399,7 +399,8 @@ impl<T: Ord> BinaryHeap<T> {
399
///
400
/// # Time complexity
401
402
- /// Cost is *O*(1) in the worst case.
+ /// If the item is modified then the worst case time complexity is *O*(log(*n*)),
403
+ /// otherwise it's *O*(1).
404
#[stable(feature = "binary_heap_peek_mut", since = "1.12.0")]
405
pub fn peek_mut(&mut self) -> Option<PeekMut<'_, T>> {
406
if self.is_empty() { None } else { Some(PeekMut { heap: self, sift: false }) }
0 commit comments