Skip to content

Commit

Permalink
SAM-3075 - Changes to suggested by @master-bob to improve lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
master-bob authored and jonespm committed Dec 13, 2016
1 parent 37dc4bc commit 30bee9a
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeMap;
import javax.faces.application.FacesMessage;
Expand Down Expand Up @@ -1766,21 +1765,14 @@ public void deleteExtendedTime() {
public void editExtendedTime() {
this.editingExtendedTime = true;
this.extendedTime = new ExtendedTime(this.transitoryExtendedTime);
this.transitoryExtendedTime = null;
}

public void saveEditedExtendedTime() {
this.editingExtendedTime = false;
Integer oldIndex = null;
// is there a more efficient way?
for(ExtendedTime entry : extendedTimes) {
if(Objects.equals(entry.getId(), this.extendedTime.getId())) {
oldIndex = this.extendedTimes.indexOf(entry);
break;
}
}
Integer oldIndex = extendedTimes.indexOf(this.transitoryExtendedTime);
this.extendedTimes.set(oldIndex, this.extendedTime);
resetExtendedTime();
this.transitoryExtendedTime = null;
}

public void cancelEdit() {
Expand Down

0 comments on commit 30bee9a

Please sign in to comment.