1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00
This commit is contained in:
oblonski 2019-07-19 10:41:20 +02:00
parent af69361cd4
commit 7351a05730
No known key found for this signature in database
GPG key ID: 179DE487285680D1

View file

@ -46,8 +46,7 @@ public class TourActivities {
@Override @Override
public boolean hasNext() { public boolean hasNext() {
if (currentIndex >= 0) return true; return currentIndex >= 0;
return false;
} }
@Override @Override
@ -67,9 +66,9 @@ public class TourActivities {
} }
} }
private final ArrayList<TourActivity> tourActivities = new ArrayList<TourActivity>(); private final ArrayList<TourActivity> tourActivities = new ArrayList<>();
private final Set<Job> jobs = new HashSet<Job>(); private final Set<Job> jobs = new HashSet<>();
private ReverseActivityIterator backward; private ReverseActivityIterator backward;
@ -123,7 +122,7 @@ public class TourActivities {
* @return true if job has been removed, otherwise false. * @return true if job has been removed, otherwise false.
*/ */
public boolean removeJob(Job job) { public boolean removeJob(Job job) {
boolean jobRemoved = false; boolean jobRemoved;
if (!jobs.contains(job)) { if (!jobs.contains(job)) {
return false; return false;
} else { } else {
@ -161,7 +160,7 @@ public class TourActivities {
} }
boolean jobIsAlsoAssociateToOtherActs = false; boolean jobIsAlsoAssociateToOtherActs = false;
boolean actRemoved = false; boolean actRemoved = false;
List<TourActivity> acts = new ArrayList<TourActivity>(tourActivities); List<TourActivity> acts = new ArrayList<>(tourActivities);
for (TourActivity act : acts) { for (TourActivity act : acts) {
if (act == activity) { if (act == activity) {
tourActivities.remove(act); tourActivities.remove(act);