On Wed, 15 Mar 2023 18:48:02 GMT, Pavel Rappo <[email protected]> wrote:
>> There's a cost of changing that to this:
>>
>> // protect from unintended change
>> orderedMembers.replaceAll((k, l) -> Collections.unmodifiableList(l));
>> namedMembers.replaceAll((k, m) -> Collections.unmodifiableMap(m));
>>
>> That cost is using default values for absent kinds:
>>
>> List<Element> getOrderedMembers(Kind kind) {
>> return orderedMembers.getOrDefault(kind, List.of());
>> }
>>
>> List<Element> getMembers(Name simpleName, Kind kind) {
>> return namedMembers.getOrDefault(kind, Map.of())
>> .getOrDefault(simpleName, List.of());
>> }
>>
>> Or did you mean something else?
>
> I don't mind either way; @jonathan-gibbons do you have a preference?
TANSTAAFL
I suggest to leave the code as-is.
-------------
PR: https://git.openjdk.org/jdk/pull/13044