On Tue, 25 Mar 2025 23:28:46 GMT, Johannes Graham <d...@openjdk.org> wrote:
>> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Revamp toString() methods > > src/java.base/share/classes/jdk/internal/lang/stable/StableValueFactories.java > line 41: > >> 39: public static <T, R> Function<T, R> function(Set<? extends T> inputs, >> 40: Function<? super T, ? >> extends R> original) { >> 41: if (inputs.isEmpty()) { > > If it is worth optimizing the isEmpty scenario, it might be preferable to let > each xxxFunction.of return an appropriate instance, to keep the number of > varying subclasses to a minimum. I've removed the specialized empty class. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2020469763