refactor new_unique_id()
This commit is contained in:
parent
5f736cc653
commit
6689fe1e1f
|
@ -171,16 +171,9 @@ fn new_unique_id(mut ids: Vec<String>) -> String {
|
|||
|
||||
let mut new_id: u64 = 0;
|
||||
|
||||
for id in ids {
|
||||
let id= from_base36(&id);
|
||||
if id.is_ok() {
|
||||
if new_id != id.unwrap() {
|
||||
break;
|
||||
}
|
||||
|
||||
while ids.contains(&new_id.to_base36()) {
|
||||
new_id += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return to_base36(new_id);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue