Skip to content

Commit

Permalink
Optimize the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
msdx committed Jun 16, 2016
1 parent 8af9477 commit 9347193
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,8 @@ public void setLabel(String label) {
* @param index the index
*/
public void setSelectedIndex(int index) {
for (int i = 0; i < options.size(); i++) {
if (index == i) {
selectedOption = options.get(index);
break;
}
if (index >=0 && index < options.size()) {
selectedOption = options.get(index);
}
}

Expand Down

0 comments on commit 9347193

Please sign in to comment.