Skip to content

Commit 9c28ca8

Browse files
committed
Add constant for frequency. Remove unused variables
1 parent 67b2621 commit 9c28ca8

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

plugins/logcleaner/logcleaner.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ static bool clear_combat = false;
3131
static bool clear_sparring = true;
3232
static bool clear_hunting = false;
3333

34-
static void cleanupLogs(color_ostream& out);
34+
static const int32_t CLEANUP_TICK_INTERVAL = 97;
35+
36+
static void cleanupLogs();
3537
static command_result do_command(color_ostream& out, std::vector<std::string>& params);
3638

3739
// Getter functions for Lua
@@ -124,7 +126,7 @@ DFhackCExport command_result plugin_onstatechange(color_ostream& out, state_chan
124126
return CR_OK;
125127
}
126128

127-
static void cleanupLogs(color_ostream& out) {
129+
static void cleanupLogs() {
128130
if (!is_enabled || !world)
129131
return;
130132

@@ -170,9 +172,9 @@ DFhackCExport command_result plugin_onupdate(color_ostream& out, state_change_ev
170172
return CR_OK;
171173

172174
tick_counter++;
173-
if (tick_counter >= 100) {
175+
if (tick_counter >= CLEANUP_TICK_INTERVAL) {
174176
tick_counter = 0;
175-
cleanupLogs(out);
177+
cleanupLogs();
176178
}
177179

178180
return CR_OK;

0 commit comments

Comments
 (0)