On Sun, 3 Jul 2022 19:47:16 GMT, Attila Szegedi <att...@openjdk.org> wrote:
>> Andrey Turbanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8288723: Avoid redundant ConcurrentHashMap.get call in java.time >> use computeIfAbsent where lambda could be short and static > > src/java.base/share/classes/java/time/ZoneOffset.java line 435: > >> 433: result = prev; >> 434: } >> 435: ID_CACHE.putIfAbsent(result.getId(), result); > > Feel free to ignore this one, but you could still have this be a > `computeIfAbsent` and put the ID_CACHE.putIfAbsent part in the lambda. Yeah, > there'll be more work done inside of `computeIfAbsent` but I think it's an > acceptable tradeoff for a more comprehensible code. Implemented ------------- PR: https://git.openjdk.org/jdk/pull/9208