diff options
author | Musab Kılıç <musabkilic@protonmail.com> | 2021-08-27 19:56:09 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-27 23:16:53 +0200 |
commit | 29a9be650323ea3102219cd77a148c5022f65686 (patch) | |
tree | e39fc3a39471aa400e394ba03ba75f083a56b68e /Userland/Shell | |
parent | 75a706b6eb408042a329862ba4137d2f1d0e9452 (diff) | |
download | serenity-29a9be650323ea3102219cd77a148c5022f65686.zip |
Shell: Add iteration_times.ensure_capacity() in builtin_time
Diffstat (limited to 'Userland/Shell')
-rw-r--r-- | Userland/Shell/Builtin.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Shell/Builtin.cpp b/Userland/Shell/Builtin.cpp index 3e8938d118..0046c84674 100644 --- a/Userland/Shell/Builtin.cpp +++ b/Userland/Shell/Builtin.cpp @@ -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) { |