On Tue, 29 Mar 2022 10:37:20 GMT, Claes Redestad <[email protected]> wrote:
> In `LocalDate::ofEpochDays` we validate the epoch day input, then we also > validate the year derived from that value. This second validation is > redundant since the minimum and maximum valid epoch day line up with the > first and last day of the minimum and maximum valid year, respectively. This > patch replace this redundant runtime validation with a test. > > This reduces code complexity (increasing chance for inlining to happen) and > removes a couple of branches from generated code. This pull request has now been integrated. Changeset: 072f2c46 Author: Claes Redestad <[email protected]> URL: https://git.openjdk.java.net/jdk/commit/072f2c461e8b0f10bdecadda31b3facfbe6da681 Stats: 39 lines in 2 files changed: 34 ins; 2 del; 3 mod 8283782: Redundant verification of year in LocalDate::ofEpochDay Reviewed-by: rriggs, naoto ------------- PR: https://git.openjdk.java.net/jdk/pull/8014
