Skip to content

Commit 5b6c1a2

Browse files
committed
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.
1 parent ef2c404 commit 5b6c1a2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/libcore/to_bytes.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ impl<A: IterBytes, B: IterBytes> (A,B): IterBytes {
196196
pure fn iter_bytes(lsb0: bool, f: Cb) {
197197
match self {
198198
(ref a, ref b) => {
199-
a.iter_bytes(lsb0, f);
200-
b.iter_bytes(lsb0, f);
199+
iter_bytes_2(a, b, lsb0, f);
201200
}
202201
}
203202
}
@@ -208,9 +207,7 @@ impl<A: IterBytes, B: IterBytes, C: IterBytes> (A,B,C): IterBytes {
208207
pure fn iter_bytes(lsb0: bool, f: Cb) {
209208
match self {
210209
(ref a, ref b, ref c) => {
211-
a.iter_bytes(lsb0, f);
212-
b.iter_bytes(lsb0, f);
213-
c.iter_bytes(lsb0, f);
210+
iter_bytes_3(a, b, c, lsb0, f);
214211
}
215212
}
216213
}

0 commit comments

Comments
 (0)