From aa1dae4c40f28b7902158a57d420fb235e757454 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 27 Nov 2016 18:19:23 +0100 Subject: [PATCH] Removing duplicated loop. Two loops were doing the same (appending letters) --- .../java/org/craftedsw/romannumerals/RomanNumeralGenerator.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/TDD/sandromancuso/romannumerals/src/main/java/org/craftedsw/romannumerals/RomanNumeralGenerator.java b/TDD/sandromancuso/romannumerals/src/main/java/org/craftedsw/romannumerals/RomanNumeralGenerator.java index e24a8da..4f7f40d 100644 --- a/TDD/sandromancuso/romannumerals/src/main/java/org/craftedsw/romannumerals/RomanNumeralGenerator.java +++ b/TDD/sandromancuso/romannumerals/src/main/java/org/craftedsw/romannumerals/RomanNumeralGenerator.java @@ -10,16 +10,14 @@ public class RomanNumeralGenerator { decimal -= romanToDecimal.decimal; } } - for (int i = 0; i < decimal; i++) { - roman += "I"; - } return roman; } enum RomanToDecimal { TEN("X", 10), - FIVE("V", 5); + FIVE("V", 5), + ONE("I", 1); private final String roman; private final int decimal; -- 2.1.4