Fix a bug that caused memory usage to skyrocket because 0 is a meanie

This commit is contained in:
Daniel Odendahl Jr
2018-02-22 21:21:03 +00:00
parent 66692f1b1d
commit fd108da04a
2 changed files with 2 additions and 2 deletions
+1 -2
View File
@@ -11,6 +11,5 @@
"IX": 9,
"V": 5,
"IV": 4,
"I": 1,
"_nulla_": 0
"I": 1
}
+1
View File
@@ -22,6 +22,7 @@ module.exports = class RomanNumeralCommand extends Command {
}
run(msg, { number }) {
if (number === 0) return msg.say('_nulla_');
let result = '';
for (const [numeral, value] of Object.entries(numerals)) {
while (number >= value) {