RFR: 1821: The 'timeline` API in GitHub doesn't point out the sorting order [v2]

Guoxiong Li gli at openjdk.org
Wed Feb 15 14:35:16 UTC 2023


On Wed, 15 Feb 2023 14:03:29 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> forge/src/main/java/org/openjdk/skara/forge/github/GitHubPullRequest.java line 776:
>> 
>>> 774:                           var secondTime = ZonedDateTime.parse(second.get("created_at").asString());
>>> 775:                           return firstTime.compareTo(secondTime);
>>> 776:                       })
>> 
>> Suggestion:
>> 
>>                       .max(Comparator.comparing(o -> ZonedDateTime.parse(o.get("created_at").asString())))
>
> It will parse the date up to two times for each element, but I think that's ok. There shouldn't be that many of them.

Fixed.

-------------

PR: https://git.openjdk.org/skara/pull/1473


More information about the skara-dev mailing list