mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
Shell: Add iteration_times.ensure_capacity() in builtin_time
This commit is contained in:
parent
75a706b6eb
commit
29a9be6503
Notes:
sideshowbarker
2024-07-18 05:12:20 +09:00
Author: https://github.com/musabkilic 🔰 Commit: https://github.com/SerenityOS/serenity/commit/29a9be65032 Pull-request: https://github.com/SerenityOS/serenity/pull/9645
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…
Reference in a new issue