Skip to content

Commit f8fbc34

Browse files
Seulgi Kimsgkim126
authored andcommitted
Use Range::contains
It's stabilized in 1.35.0.
1 parent 54408eb commit f8fbc34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/miner/mem_pool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ impl MemPool {
907907
}
908908
true
909909
})
910-
.filter(|t| range.start <= t.inserted_timestamp && t.inserted_timestamp < range.end)
910+
.filter(|t| range.contains(&t.inserted_timestamp))
911911
.take_while(|t| {
912912
let encoded_byte_array: Vec<u8> = rlp::encode(&t.tx).into_vec();
913913
let size_in_byte = encoded_byte_array.len();
@@ -935,7 +935,7 @@ impl MemPool {
935935
.get(&t.hash)
936936
.expect("All transactions in `current` and `future` are always included in `by_hash`")
937937
})
938-
.filter(|t| range.start <= t.inserted_timestamp && t.inserted_timestamp < range.end)
938+
.filter(|t| range.contains(&t.inserted_timestamp))
939939
.count()
940940
}
941941

0 commit comments

Comments
 (0)