Skip to content

Commit 7c6723d

Browse files
committed
Print progress bar even if there is only one file
1 parent 1febf2e commit 7c6723d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

benchmark/parse.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ struct option_struct {
8383
bool stage1_only = false;
8484

8585
int32_t iterations = 200;
86-
int32_t iteration_step = 50;
86+
int32_t iteration_step = -1;
8787

8888
bool verbose = false;
8989
bool tabbed_output = false;
@@ -149,18 +149,19 @@ struct option_struct {
149149
}
150150
}
151151

152+
if (iteration_step == -1) {
153+
iteration_step = iterations / 50;
154+
if (iteration_step < 200) { iteration_step = 200; }
155+
if (iteration_step > iterations) { iteration_step = iterations; }
156+
}
157+
152158
// All remaining arguments are considered to be files
153159
for (int i=optind; i<argc; i++) {
154160
files.push_back(argv[i]);
155161
}
156162
if (files.empty()) {
157163
exit_usage("No files specified");
158164
}
159-
160-
// Keeps the numbers the same for CI (old ./parse didn't have a two-stage loop)
161-
if (files.size() == 1) {
162-
iteration_step = iterations;
163-
}
164165
}
165166
};
166167

0 commit comments

Comments
 (0)