3 ms·
Shouldn't that be: Foo value = ( someCondition() ? map1 : map2 ).computeIfAbsent("key", defaultValueProvider); Or some kind of moral equivalent?
by Mithaldu 9y ago
Shouldn't that be:
Foo value = ( someCondition() ? map1 : map2 ).computeIfAbsent("key", defaultValueProvider);
Or some kind of moral equivalent?
- TeMPOraL 9y agoCould be, though this is an artifact of a simplified example that I didn't mean to be relevant here. For clarity, let's rewrite it as: Foo value = someCondition() ? map1.computeIfAbsent("key", defaultValueProvider) : list1.get(42);