@@ -394,8 +394,8 @@ fn MergeState<T>() -> MergeState<T> {
394
394
}
395
395
}
396
396
397
- impl < T : Ord > & MergeState < T > {
398
- fn binarysort ( array : & [ mut T ] , start : uint ) {
397
+ impl < T : Ord > MergeState < T > {
398
+ fn binarysort ( & self , array : & [ mut T ] , start : uint ) {
399
399
let size = array. len ( ) ;
400
400
let mut start = start;
401
401
assert start <= size;
@@ -434,12 +434,12 @@ impl<T: Ord> &MergeState<T> {
434
434
self . last_bsort = false ;
435
435
}
436
436
437
- fn push_run ( run_base : uint , run_len : uint ) {
437
+ fn push_run ( & self , run_base : uint , run_len : uint ) {
438
438
let tmp = RunState { base : run_base, len : run_len} ;
439
439
self . runs . push ( tmp) ;
440
440
}
441
441
442
- fn merge_at ( n : uint , array : & [ mut T ] ) {
442
+ fn merge_at ( & self , n : uint , array : & [ mut T ] ) {
443
443
let mut size = self . runs . len ( ) ;
444
444
assert size >= 2 ;
445
445
assert n == size-2 || n == size-3 ;
@@ -483,7 +483,7 @@ impl<T: Ord> &MergeState<T> {
483
483
self . mergePt = 0 ;
484
484
}
485
485
486
- fn merge_lo ( array : & [ mut T ] , base1 : uint , len1 : uint ,
486
+ fn merge_lo ( & self , array : & [ mut T ] , base1 : uint , len1 : uint ,
487
487
base2 : uint , len2 : uint ) {
488
488
assert len1 != 0 && len2 != 0 && base1+len1 == base2;
489
489
@@ -619,7 +619,7 @@ impl<T: Ord> &MergeState<T> {
619
619
unsafe { vec::raw::set_len(&mut self.tmp, 0); }
620
620
}
621
621
622
- fn merge_hi(array: &[mut T], base1: uint, len1: uint,
622
+ fn merge_hi(&self, array: &[mut T], base1: uint, len1: uint,
623
623
base2: uint, len2: uint) {
624
624
assert len1 != 1 && len2 != 0 && base1 + len1 == base2;
625
625
@@ -762,7 +762,7 @@ impl<T: Ord> &MergeState<T> {
762
762
unsafe { vec:: raw:: set_len ( & mut self . tmp , 0 ) ; }
763
763
}
764
764
765
- fn merge_collapse ( array : & [ mut T ] ) {
765
+ fn merge_collapse ( & self , array : & [ mut T ] ) {
766
766
while self . runs . len ( ) > 1 {
767
767
let mut n = self . runs . len ( ) -2 ;
768
768
let chk = do self . runs . borrow |arr| {
@@ -780,7 +780,7 @@ impl<T: Ord> &MergeState<T> {
780
780
}
781
781
}
782
782
783
- fn merge_force_collapse ( array : & [ mut T ] ) {
783
+ fn merge_force_collapse ( & self , array : & [ mut T ] ) {
784
784
while self . runs . len ( ) > 1 {
785
785
let mut n = self . runs . len ( ) -2 ;
786
786
if n > 0 {
0 commit comments