Integrated: 8286270: [java.desktop] Replace color search in XColors with a switch statement

SWinxy duke at openjdk.org
Fri Jul 22 18:41:08 UTC 2022


On Sat, 15 Jan 2022 03:44:17 GMT, SWinxy <duke at openjdk.org> wrote:

> The current implementation creates ~750 new objects on load, and uses a binary array search with a Comparable implementation. This implementation is probably bad. Instead, we can use the enhanced switch feature to possibly save time, resources, and code size. The new implementation means that the array doesn't have to be sorted alphanumerically necessarily, and it creates the colors on demand.

This pull request has now been integrated.

Changeset: ef8486a1
Author:    SWinxy <swinxythecat at gmail.com>
Committer: Phil Race <prr at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/ef8486a1a40c8b65d3db6048c3dc79802073148d
Stats:     1300 lines in 1 file changed: 508 ins; 784 del; 8 mod

8286270: [java.desktop] Replace color search in XColors with a switch statement

Reviewed-by: prr, azvegint

-------------

PR: https://git.openjdk.org/jdk/pull/7096



More information about the client-libs-dev mailing list