Skip to content

Commit 845465e

Browse files
committed
old_iter: rm the min/max free functions
1 parent 52a38b8 commit 845465e

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

src/libstd/old_iter.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -187,40 +187,6 @@ pub fn position<A,IA:BaseIter<A>>(this: &IA, f: &fn(&A) -> bool)
187187
return None;
188188
}
189189

190-
// note: 'rposition' would only make sense to provide with a bidirectional
191-
// iter interface, such as would provide "reach" in addition to "each". As is,
192-
// it would have to be implemented with foldr, which is too inefficient.
193-
194-
#[inline(always)]
195-
pub fn min<A:Copy + Ord,IA:BaseIter<A>>(this: &IA) -> A {
196-
match do foldl::<A,Option<A>,IA>(this, None) |a, b| {
197-
match a {
198-
&Some(ref a_) if *a_ < *b => {
199-
*(a)
200-
}
201-
_ => Some(*b)
202-
}
203-
} {
204-
Some(val) => val,
205-
None => fail!("min called on empty iterator")
206-
}
207-
}
208-
209-
#[inline(always)]
210-
pub fn max<A:Copy + Ord,IA:BaseIter<A>>(this: &IA) -> A {
211-
match do foldl::<A,Option<A>,IA>(this, None) |a, b| {
212-
match a {
213-
&Some(ref a_) if *a_ > *b => {
214-
*(a)
215-
}
216-
_ => Some(*b)
217-
}
218-
} {
219-
Some(val) => val,
220-
None => fail!("max called on empty iterator")
221-
}
222-
}
223-
224190
#[inline(always)]
225191
pub fn find<A:Copy,IA:BaseIter<A>>(this: &IA, f: &fn(&A) -> bool)
226192
-> Option<A> {

0 commit comments

Comments
 (0)