Skip to content

Instantly share code, notes, and snippets.

@rosenpin
Created January 29, 2016 18:51
Show Gist options
  • Save rosenpin/a6cf66293f846c0e31f3 to your computer and use it in GitHub Desktop.
Save rosenpin/a6cf66293f846c0e31f3 to your computer and use it in GitHub Desktop.
if (options.size() < 5) {
final int optionSize = options.size();
for (int i = 0; i < 4 - optionSize; ) {
boolean toAdd = true;
for (int a = 0; a < optionSize; a++) {
if (options2.get(i).getTitle().equals(options.get(a).getTitle())) {
toAdd = false;
break;
}
}
if (toAdd) {
options.add(options2.get(i));
i++;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment