From f98f00f7f6afac993fd2a08e7135bfdb8e70dec6 Mon Sep 17 00:00:00 2001 From: Simon BD Date: Thu, 27 Sep 2012 18:15:57 -0500 Subject: [PATCH] Fix timsort to use updated vec::reserve --- src/libstd/sort.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs index 8cd98f8ab0b..4f8102515ce 100644 --- a/src/libstd/sort.rs +++ b/src/libstd/sort.rs @@ -219,8 +219,8 @@ fn binarysort(array: &[mut T], start: uint) { if start == 0 { start += 1; } - let mut pivot = ~[mut]; - vec::reserve(pivot, 1); + let mut pivot = ~[]; + vec::reserve(&mut pivot, 1); unsafe { vec::raw::set_len(pivot, 1); }; while start < size { @@ -409,7 +409,7 @@ struct MergeState { fn MergeState() -> MergeState { let mut tmp = ~[]; - vec::reserve(tmp, INITIAL_TMP_STORAGE); + vec::reserve(&mut tmp, INITIAL_TMP_STORAGE); MergeState { minGallop: MIN_GALLOP, tmp: tmp, @@ -467,7 +467,7 @@ fn mergeAt(n: uint, array: &[mut T]) { fn mergeLo(array: &[mut T], base1: uint, len1: uint, base2: uint, len2: uint) { assert len1 != 0 && len2 != 0 && base1+len1 == base2; - vec::reserve(self.tmp, len1); + vec::reserve(&mut self.tmp, len1); unsafe { vec::raw::set_len(self.tmp, len1); @@ -587,7 +587,7 @@ fn mergeLo(array: &[mut T], base1: uint, len1: uint, base2: uint, len2: uint) { fn mergeHi(array: &[mut T], base1: uint, len1: uint, base2: uint, len2: uint) { assert len1 != 1 && len2 != 0 && base1 + len1 == base2; - vec::reserve(self.tmp, len2); + vec::reserve(&mut self.tmp, len2); unsafe { vec::raw::set_len(self.tmp, len2);