diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-08-11 16:47:46 -0700 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-08-12 13:35:56 -0700 |
| commit | f77cabecbba8d842cd944b064065ad4e6a6b760d (patch) | |
| tree | a04a154f46f5876a741a377fd5aca2c2eb9b3a60 /src/libcollections/priority_queue.rs | |
| parent | 0b5204f55efd9e25425055264d44f28501c0439b (diff) | |
| download | rust-f77cabecbba8d842cd944b064065ad4e6a6b760d.tar.gz rust-f77cabecbba8d842cd944b064065ad4e6a6b760d.zip | |
Deprecation fallout in libcollections
Diffstat (limited to 'src/libcollections/priority_queue.rs')
| -rw-r--r-- | src/libcollections/priority_queue.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcollections/priority_queue.rs b/src/libcollections/priority_queue.rs index bf2c8c83d87..a88a833c9ed 100644 --- a/src/libcollections/priority_queue.rs +++ b/src/libcollections/priority_queue.rs @@ -261,7 +261,7 @@ impl<T: Ord> PriorityQueue<T> { /// /// ``` pub fn top<'a>(&'a self) -> Option<&'a T> { - if self.is_empty() { None } else { Some(self.data.get(0)) } + if self.is_empty() { None } else { Some(&self.data[0]) } } #[deprecated="renamed to `top`"] @@ -473,7 +473,7 @@ impl<T: Ord> PriorityQueue<T> { while pos > start { let parent = (pos - 1) >> 1; - if new > *self.data.get(parent) { + if new > self.data[parent] { let x = replace(self.data.get_mut(parent), zeroed()); ptr::write(self.data.get_mut(pos), x); pos = parent; @@ -493,7 +493,7 @@ impl<T: Ord> PriorityQueue<T> { let mut child = 2 * pos + 1; while child < end { let right = child + 1; - if right < end && !(*self.data.get(child) > *self.data.get(right)) { + if right < end && !(self.data[child] > self.data[right]) { child = right; } let x = replace(self.data.get_mut(child), zeroed()); |
