From f60702b4e411222c857d5b13635560cbd09c7776 Mon Sep 17 00:00:00 2001 From: tianzw Date: Wed, 19 Jul 2023 15:06:10 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20change=20case=20orde?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + enumerations/Tanks.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 48292956e..deafe02fa 100644 --- a/.gitignore +++ b/.gitignore @@ -64,6 +64,7 @@ io/test.gz io/X.file *.pyc +bin *.out *.err /files/bytes.dat diff --git a/enumerations/Tanks.java b/enumerations/Tanks.java index 0604693f5..7828c54d3 100644 --- a/enumerations/Tanks.java +++ b/enumerations/Tanks.java @@ -23,12 +23,12 @@ record Tank(Type type, Level level) {} public class Tanks { static String check(Tank tank) { return switch(tank) { - case Tank t && t.type() == Type.TOXIC - -> "Toxic: " + t; case Tank t && ( // [1] t.type() == Type.TOXIC && t.level().percent() < 50 ) -> "Toxic, low: " + t; + case Tank t && t.type() == Type.TOXIC + -> "Toxic: " + t; case Tank t && t.type() == Type.FLAMMABLE -> "Flammable: " + t; // Equivalent to "default":