Skip to content

Commit

Permalink
pop() performs better than shift()
Browse files Browse the repository at this point in the history
Rename method
  • Loading branch information
yusu-banana committed Jan 6, 2024
1 parent 8f7a26c commit 9a52305
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/commands/chatters/artemis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ class Artemis {

protected shuffledBag: string[] = []

private getFact(): string | undefined {
private get_fact(): string | undefined {
if (!this.shuffledBag.length) {
this.shuffledBag = [...this.facts]
shuffleArray(this.shuffledBag)
}

return this.shuffledBag.shift()
return this.shuffledBag.pop()
}

@SimpleCommand({ name: 'artemis', description: 'Artemis' })
Expand All @@ -65,7 +65,7 @@ class Artemis {
command: SimpleCommandMessage
) {
await command.message.channel.send({
content: this.getFact(),
content: this.get_fact(),
})
return
}
Expand Down

0 comments on commit 9a52305

Please sign in to comment.