Skip to content

Commit 77adc44

Browse files
committed
refactor: move correctMinutesWord inside block
Move the `correctMinutesWord` string inside the if-statement below it due to the fact that that is the only place where that variable is being used. `remainingMinutes` is left intact in the same scope since it is needed as a reference in the if-statement itself to compare against zero. Suggested-by: Zabuzard <zabuza.dev@gmail.com> Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
1 parent 98cdec5 commit 77adc44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

application/src/main/java/org/togetherjava/tjbot/features/roleapplication/CreateRoleApplicationCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ public void onStringSelectSelection(StringSelectInteractionEvent event, List<Str
124124
}
125125

126126
long remainingMinutes = handler.getMemberCooldownMinutes(member);
127-
String correctMinutesWord = remainingMinutes == 1 ? "minute" : "minutes";
128-
129127
if (remainingMinutes > 0) {
128+
String correctMinutesWord = remainingMinutes == 1 ? "minute" : "minutes";
129+
130130
event
131131
.reply("Please wait %d %s before sending a new application form."
132132
.formatted(remainingMinutes, correctMinutesWord))

0 commit comments

Comments
 (0)