summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorMichael Arntzenius <daekharel@gmail.com>2012-12-02 20:01:28 -0500
committerMichael Arntzenius <daekharel@gmail.com>2012-12-02 20:01:28 -0500
commit5b6c1a2950ba2a8b6377a387f666b0e50c45fc4f (patch)
tree12adffd835c225ec9adfc3d77fb65c87c8b4b38e /src/libcore
parentef2c404e01108a7bd7465bd23d40ff989848bffd (diff)
downloadrust-5b6c1a2950ba2a8b6377a387f666b0e50c45fc4f.tar.gz
rust-5b6c1a2950ba2a8b6377a387f666b0e50c45fc4f.zip
call out to iter_bytes_{2,3} in IterBytes instances for pairs, triples
This means we will exit early if requested based on the return value of the
callback we're given.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/to_bytes.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libcore/to_bytes.rs b/src/libcore/to_bytes.rs
index 238b4342a63..4ffa24e014e 100644
--- a/src/libcore/to_bytes.rs
+++ b/src/libcore/to_bytes.rs
@@ -196,8 +196,7 @@ impl<A: IterBytes, B: IterBytes> (A,B): IterBytes {
   pure fn iter_bytes(lsb0: bool, f: Cb) {
     match self {
       (ref a, ref b) => {
-        a.iter_bytes(lsb0, f);
-        b.iter_bytes(lsb0, f);
+        iter_bytes_2(a, b, lsb0, f);
       }
     }
   }
@@ -208,9 +207,7 @@ impl<A: IterBytes, B: IterBytes, C: IterBytes> (A,B,C): IterBytes {
   pure fn iter_bytes(lsb0: bool, f: Cb) {
     match self {
       (ref a, ref b, ref c) => {
-        a.iter_bytes(lsb0, f);
-        b.iter_bytes(lsb0, f);
-        c.iter_bytes(lsb0, f);
+        iter_bytes_3(a, b, c, lsb0, f);
       }
     }
   }