Merge pull request #1503 from jotomo/cmd-queue-remove-all
[For review] Queue: correct removal of queued command by type.
This commit is contained in:
commit
4d5ee23245
|
@ -96,7 +96,7 @@ public class CommandQueue {
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void removeAll(Command.CommandType type) {
|
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) {
|
if (queue.get(i).commandType == type) {
|
||||||
queue.remove(i);
|
queue.remove(i);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue