From fd91e333a5a37148f503022b959d894437a1527b Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sun, 28 Jun 2020 09:19:55 +0100 Subject: [PATCH] optimise new_unique_id() --- src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 634a5ca..3f44254 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -165,10 +165,7 @@ fn is_id_available(ids: &Vec, id: &String) -> bool { /// e.g. pass all tile IDs into this to get a new non-conflicting tile ID #[inline] -fn new_unique_id(mut ids: Vec) -> String { - ids.sort(); - ids.dedup(); - +fn new_unique_id(ids: Vec) -> String { let mut new_id: u64 = 0; while ids.contains(&new_id.to_base36()) {