diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-06-15 19:24:20 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-06-15 22:16:22 -0400 |
| commit | 845465ee246bee760b8ef0da725f8a711bfc23c9 (patch) | |
| tree | cb3b9664075956496122a9f56b801bd0aee815a1 /src/libstd | |
| parent | 52a38b80976be2025b466c144030bb7e7165d32b (diff) | |
| download | rust-845465ee246bee760b8ef0da725f8a711bfc23c9.tar.gz rust-845465ee246bee760b8ef0da725f8a711bfc23c9.zip | |
old_iter: rm the min/max free functions
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/old_iter.rs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/libstd/old_iter.rs b/src/libstd/old_iter.rs index 39f3a81ad21..347b4774422 100644 --- a/src/libstd/old_iter.rs +++ b/src/libstd/old_iter.rs @@ -187,40 +187,6 @@ pub fn position<A,IA:BaseIter<A>>(this: &IA, f: &fn(&A) -> bool) return None; } -// note: 'rposition' would only make sense to provide with a bidirectional -// iter interface, such as would provide "reach" in addition to "each". As is, -// it would have to be implemented with foldr, which is too inefficient. - -#[inline(always)] -pub fn min<A:Copy + Ord,IA:BaseIter<A>>(this: &IA) -> A { - match do foldl::<A,Option<A>,IA>(this, None) |a, b| { - match a { - &Some(ref a_) if *a_ < *b => { - *(a) - } - _ => Some(*b) - } - } { - Some(val) => val, - None => fail!("min called on empty iterator") - } -} - -#[inline(always)] -pub fn max<A:Copy + Ord,IA:BaseIter<A>>(this: &IA) -> A { - match do foldl::<A,Option<A>,IA>(this, None) |a, b| { - match a { - &Some(ref a_) if *a_ > *b => { - *(a) - } - _ => Some(*b) - } - } { - Some(val) => val, - None => fail!("max called on empty iterator") - } -} - #[inline(always)] pub fn find<A:Copy,IA:BaseIter<A>>(this: &IA, f: &fn(&A) -> bool) -> Option<A> { |
