mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Use [pattern matching switch expressions](https://docs.oracle.com/en/java/javase/17/language/pattern-matching-switch.html) where possible. This is a JVM 21+ feature which wasn't available until recently. If you look at the Java bytecode, this improves performance from an O(n) runtime check of literally each of the `if (x instanceof y)` checks to instead be an O(1) tableswitch. --------- Signed-off-by: Jonah Snider <jonah@jonahsnider.com>