Skip to content

Commit 3e501b2

Browse files
authored
Merge pull request opentripplanner#6868 from entur/simplify_trip_pattern_for_date_hashcode
Simplify Hashcode in TripPatternForDate
2 parents 1ab6926 + 77c8ae1 commit 3e501b2

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

application/src/main/java/org/opentripplanner/routing/algorithm/raptoradapter/transit/TripPatternForDate.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,18 @@ public int compareTo(TripPatternForDate other) {
158158
return serviceDate.compareTo(other.serviceDate);
159159
}
160160

161+
/**
162+
* The natural key of a TripPatternForDate is the pair (routing trip pattern id, service date).
163+
*/
161164
@Override
162165
public int hashCode() {
163-
return Objects.hash(
164-
tripPattern,
165-
serviceDate,
166-
Arrays.hashCode(tripTimes),
167-
Arrays.hashCode(frequencies)
168-
);
166+
return Objects.hash(tripPattern, serviceDate);
169167
}
170168

169+
/**
170+
* The natural key of a TripPatternForDate is the pair (routing trip pattern id, service date).
171+
* TODO: align equals and hashcode to use only the pair (routing trip pattern id, service date)
172+
*/
171173
@Override
172174
public boolean equals(Object o) {
173175
if (this == o) {

0 commit comments

Comments
 (0)