mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 05:51:35 +02:00
Fix a bug that caused memory usage to skyrocket because 0 is a meanie
This commit is contained in:
@@ -11,6 +11,5 @@
|
|||||||
"IX": 9,
|
"IX": 9,
|
||||||
"V": 5,
|
"V": 5,
|
||||||
"IV": 4,
|
"IV": 4,
|
||||||
"I": 1,
|
"I": 1
|
||||||
"_nulla_": 0
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ module.exports = class RomanNumeralCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run(msg, { number }) {
|
run(msg, { number }) {
|
||||||
|
if (number === 0) return msg.say('_nulla_');
|
||||||
let result = '';
|
let result = '';
|
||||||
for (const [numeral, value] of Object.entries(numerals)) {
|
for (const [numeral, value] of Object.entries(numerals)) {
|
||||||
while (number >= value) {
|
while (number >= value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user