We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de0edbf commit 6fbe31cCopy full SHA for 6fbe31c
1 file changed
src/receive.rs
@@ -1364,8 +1364,13 @@ impl DiscoveredSacnSource {
1364
pub fn has_all_pages(&mut self) -> bool {
1365
// https://rust-lang-nursery.github.io/rust-cookbook/algorithms/sorting.html (31/12/2019)
1366
self.pages.sort_by(|a, b| a.page.cmp(&b.page));
1367
- for i in 0..(self.last_page + 1) {
1368
- if self.pages[i as usize].page != i {
+ for i in 0..=self.last_page {
+ if self
1369
+ .pages
1370
+ .get(i as usize)
1371
+ .map(|p| p.page != i)
1372
+ .unwrap_or(true)
1373
+ {
1374
return false;
1375
}
1376
0 commit comments