mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
length comparison to zero in /civ/mod.rs
warning: length comparison to zero --> world/src/civ/mod.rs:482:15 | 482 | while to_explore.len() > 0 { | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_explore.is_empty()` | = note: `#[warn(clippy::len_zero)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero warning: length comparison to zero --> world/src/civ/mod.rs:489:19 | 489 | while to_floodfill.len() > 0 { | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_floodfill.is_empty()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
This commit is contained in:
parent
fd920cea1d
commit
1a5c1ae319
@ -479,14 +479,14 @@ impl Civs {
|
||||
to_explore.insert(start_point);
|
||||
explored.insert(start_point);
|
||||
|
||||
while to_explore.len() > 0 {
|
||||
while !to_explore.is_empty() {
|
||||
let exploring = *to_explore.iter().next().unwrap();
|
||||
to_explore.remove(&exploring);
|
||||
to_floodfill.insert(exploring);
|
||||
// Should always be a chunk on the map
|
||||
let biome = ctx.sim.chunks[exploring].get_biome();
|
||||
biomes.push((biome, Vec::new()));
|
||||
while to_floodfill.len() > 0 {
|
||||
while !to_floodfill.is_empty() {
|
||||
let filling = *to_floodfill.iter().next().unwrap();
|
||||
to_explore.remove(&filling);
|
||||
to_floodfill.remove(&filling);
|
||||
|
Loading…
Reference in New Issue
Block a user