Queue: correct removal of queued command by type.

This commit is contained in:
Johannes Mockenhaupt 2018-10-12 16:19:34 +02:00
parent a0a60ea2d6
commit 682b56198a
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -96,7 +96,7 @@ public class CommandQueue {
}
private synchronized void removeAll(Command.CommandType type) {
for (int i = 0; i < queue.size(); i++) {
for (int i = queue.size() - 1; i >= 0; i--) {
if (queue.get(i).commandType == type) {
queue.remove(i);
}