Skip to content

Commit

Permalink
call out to iter_bytes_{2,3} in IterBytes instances for pairs, triples
Browse files Browse the repository at this point in the history
This means we will exit early if requested based on the return value of the
callback we're given.
  • Loading branch information
rntz committed Dec 3, 2012
1 parent ef2c404 commit 5b6c1a2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/libcore/to_bytes.rs
Expand Up @@ -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);
}
}
}
Expand All @@ -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);
}
}
}
Expand Down

0 comments on commit 5b6c1a2

Please sign in to comment.