about summary refs log tree commit diff
path: root/src/libcore/iter.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/iter.rs')
-rw-r--r--src/libcore/iter.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index c5f395d376c..0280221ebfc 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -99,10 +99,10 @@ fn position<A,IA:base_iter<A>>(self: IA, f: fn(A) -> bool)
 // 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.
 
-fn repeat(times: uint, blk: fn()) {
+fn repeat(times: uint, blk: fn() -> bool) {
     let mut i = 0u;
     while i < times {
-        blk();
+        if !blk() { break }
         i += 1u;
     }
 }