From 5b6c1a2950ba2a8b6377a387f666b0e50c45fc4f Mon Sep 17 00:00:00 2001 From: Michael Arntzenius Date: Sun, 2 Dec 2012 20:01:28 -0500 Subject: [PATCH] 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. --- src/libcore/to_bytes.rs | 7 ++----- 1 file 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,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,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); } } }