list.size > 0 changed to !list.isEmpty

We care about if it's empty or not, not about it's size
This commit is contained in:
vraskulin 2017-01-27 16:04:56 +03:00
parent f60ebfbb1f
commit 0557b5e89c
366 changed files with 532 additions and 548 deletions

View file

@ -60,7 +60,7 @@ public class GameStates implements Serializable {
}
public GameState rollback(int index) {
if (states.size() > 0 && index < states.size()) {
if (!states.isEmpty() && index < states.size()) {
while (states.size() > index + 1) {
states.remove(states.size() - 1);
}
@ -72,8 +72,8 @@ public class GameStates implements Serializable {
}
public int remove(int index) {
if (states.size() > 0 && index < states.size()) {
while (states.size() > index && states.size() > 0) {
if (!states.isEmpty() && index < states.size()) {
while (states.size() > index && !states.isEmpty()) {
states.remove(states.size() - 1);
}
}