From 5e96602ad12cf1931d4d85ede9689fab388b5f06 Mon Sep 17 00:00:00 2001 From: Alextopher Date: Sun, 29 Sep 2024 09:34:52 -0400 Subject: [PATCH] contourshape --- .../photonvision/vision/opencv/ContourShape.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/photon-core/src/main/java/org/photonvision/vision/opencv/ContourShape.java b/photon-core/src/main/java/org/photonvision/vision/opencv/ContourShape.java index 5f7bcc8229..cf25e2c010 100644 --- a/photon-core/src/main/java/org/photonvision/vision/opencv/ContourShape.java +++ b/photon-core/src/main/java/org/photonvision/vision/opencv/ContourShape.java @@ -30,15 +30,11 @@ public enum ContourShape { } public static ContourShape fromSides(int sides) { - switch (sides) { - case 0: - return Circle; - case 3: - return Triangle; - case 4: - return Quadrilateral; - default: - return Custom; - } + return switch (sides) { + case 0 -> Circle; + case 3 -> Triangle; + case 4 -> Quadrilateral; + default -> Custom; + }; } }