RFR: 2311: Use getLast and removeLast methods for lists
Zhao Song
zsong at openjdk.org
Fri Jun 28 21:39:31 UTC 2024
On Fri, 28 Jun 2024 17:28:13 GMT, Pavel Rappo <prappo at openjdk.org> wrote:
> Please review this simple refactoring to change most if not all occurrences of `list.get(x.size() - 1)` to `list.getLast()`.
>
> `getLast` was introduced in JDK 21, as part of JEP 431: Sequenced Collections, which also introduced a counterpart method, `getFirst()`. While there are also a lot of occurrences of `list.get(0)` in Skara codebase, changing them to `list.getFirst()` might be of insufficient benefit and, hence, is not proposed in this PR. I don't think that coinciding `get(0)` and `getLast()` would look inconsistent.
>
> The copyright years will be updated after this PR has been reviewed.
LGTM! It's a very nice clean up.
-------------
Marked as reviewed by zsong (Reviewer).
PR Review: https://git.openjdk.org/skara/pull/1665#pullrequestreview-2149032585
More information about the skara-dev
mailing list