mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +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,
|
||||
"V": 5,
|
||||
"IV": 4,
|
||||
"I": 1,
|
||||
"_nulla_": 0
|
||||
"I": 1
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user