3 ms·
I guess this is exactly why java.util.Optional is a single class instead of a hierarchy of EmptyOptional for Optional#empty() and NotEmptyOptional for non null
by MiroslavPokorny 2mo ago
I guess this is exactly why java.util.Optional is a single class instead of a hierarchy of EmptyOptional for Optional#empty() and NotEmptyOptional for non null values, then true polymorhphic dispatch would be leverage for #isEmpty and other members.
- joe_mwangi 2mo agoAlso, future specialisation if it is introduced, it will enable the JIT to get enough information to ensure <T> becomes stored in cpu registeres or enable <T[]> to be flattened in memory.