Skip to content

Commit 41a4647

Browse files
committed
fixup!
Signed-off-by: Eloi Charpentier <[email protected]>
1 parent 2589d19 commit 41a4647

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

core/kt-osrd-path/src/main/kotlin/fr/sncf/osrd/path/interfaces/GenericLinearRange.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ data class GenericLinearRange<ValueType, OffsetType>(
4848

4949
/** Converts a train path offset into an object offset. */
5050
fun offsetFromTrainPath(pathOffset: Offset<TrainPath>): Offset<OffsetType> {
51-
val objectStart = Offset<TrainPath>(pathBegin.distance - objectBegin.distance)
51+
val objectStart = getObjectAbsolutePathStart()
5252
return Offset(pathOffset.distance - objectStart.distance)
5353
}
5454

5555
/** Converts an object offset into a train path offset. */
5656
fun offsetToTrainPath(objectOffset: Offset<OffsetType>): Offset<TrainPath> {
57-
val objectStart = Offset<TrainPath>(pathBegin.distance - objectBegin.distance)
57+
val objectStart = getObjectAbsolutePathStart()
5858
return objectStart + objectOffset.distance
5959
}
6060

@@ -71,8 +71,6 @@ data class GenericLinearRange<ValueType, OffsetType>(
7171
if (newPathBegin > newPathEnd) return null
7272
val removedAtStart = newPathBegin - pathBegin
7373
val removedAtEnd = pathEnd - newPathEnd
74-
assert(removedAtStart >= 0.meters)
75-
assert(removedAtEnd >= 0.meters)
7674
return GenericLinearRange(
7775
value,
7876
objectBegin + removedAtStart,

0 commit comments

Comments
 (0)