diff --git a/flyweight/README.md b/flyweight/README.md index 097bbb82e5b2..3c59f1132410 100644 --- a/flyweight/README.md +++ b/flyweight/README.md @@ -82,18 +82,14 @@ public class PotionFactory { switch (type) { case HEALING -> { potion = new HealingPotion(); - potions.put(type, potion); } case HOLY_WATER -> { potion = new HolyWaterPotion(); - potions.put(type, potion); } case INVISIBILITY -> { potion = new InvisibilityPotion(); - potions.put(type, potion); - } - default -> { } + potions.put(type, potion); } } return potion;