Skip to content

Commit

Permalink
Drop safety check from AssignmentPath.removeLast
Browse files Browse the repository at this point in the history
In its last form it relied on prism object compare operation
that could be quite expensive. Moreover, the code is now clean enough
to make such safety check unnecessary.

This should fix some failing story tests.

A part of MID-6109 implementation.
  • Loading branch information
mederly committed May 23, 2020
1 parent 9eab40c commit f970da3
Showing 1 changed file with 0 additions and 2 deletions.
Expand Up @@ -62,8 +62,6 @@ void removeLast(AssignmentPathSegmentImpl segment) {
AssignmentPathSegmentImpl last = last();
if (last == null) {
throw new IllegalStateException("Attempt to remove segment from empty path: " + this + "; segment=" + segment);
} else if (!last.equalsExceptForTarget(segment)) {
throw new IllegalStateException("Attempt to remove wrong segment from the end of path: " + this + "; segment=" + segment);
} else {
segments.remove(segments.size() - 1);
}
Expand Down

0 comments on commit f970da3

Please sign in to comment.