mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +00:00
Shell: Add iteration_times.ensure_capacity() in builtin_time
This commit is contained in:
parent
75a706b6eb
commit
29a9be6503
1 changed files with 2 additions and 1 deletions
|
@ -927,6 +927,7 @@ int Shell::builtin_time(int argc, const char** argv)
|
|||
auto commands = expand_aliases({ move(command) });
|
||||
|
||||
Vector<int> iteration_times;
|
||||
iteration_times.ensure_capacity(number_of_iterations);
|
||||
|
||||
int exit_code = 1;
|
||||
for (int i = 0; i < number_of_iterations; ++i) {
|
||||
|
@ -936,7 +937,7 @@ int Shell::builtin_time(int argc, const char** argv)
|
|||
block_on_job(job);
|
||||
exit_code = job.exit_code();
|
||||
}
|
||||
iteration_times.append(timer.elapsed());
|
||||
iteration_times.unchecked_append(timer.elapsed());
|
||||
}
|
||||
|
||||
if (number_of_iterations == 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue