fixes index out of bounds
This commit is contained in:
parent
96c67e29a4
commit
c8eb92f156
1 changed files with 2 additions and 1 deletions
|
|
@ -355,9 +355,10 @@ where
|
||||||
return None;
|
return None;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.order.remove(index as usize);
|
||||||
|
|
||||||
let position = self.order.len().min(position as usize);
|
let position = self.order.len().min(position as usize);
|
||||||
|
|
||||||
self.order.remove(index as usize);
|
|
||||||
self.order.insert(position, id);
|
self.order.insert(position, id);
|
||||||
Some(position)
|
Some(position)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue