Skip to content

Commit 9f41c18

Browse files
committed
Fix potential overflow in MergeJoinBy::size_hint
1 parent dd7fd96 commit 9f41c18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/merge_join.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl<I, J, F> Iterator for MergeJoinBy<I, J, F>
7878
let lower = ::std::cmp::max(a_lower, b_lower);
7979

8080
let upper = match (a_upper, b_upper) {
81-
(Some(x), Some(y)) => Some(x + y),
81+
(Some(x), Some(y)) => x.checked_add(y),
8282
_ => None,
8383
};
8484

0 commit comments

Comments
 (0)