summaryrefslogtreecommitdiff
path: root/Userland/Shell
diff options
context:
space:
mode:
authorMusab Kılıç <musabkilic@protonmail.com>2021-08-27 19:56:09 +0300
committerAndreas Kling <kling@serenityos.org>2021-08-27 23:16:53 +0200
commit29a9be650323ea3102219cd77a148c5022f65686 (patch)
treee39fc3a39471aa400e394ba03ba75f083a56b68e /Userland/Shell
parent75a706b6eb408042a329862ba4137d2f1d0e9452 (diff)
downloadserenity-29a9be650323ea3102219cd77a148c5022f65686.zip
Shell: Add iteration_times.ensure_capacity() in builtin_time
Diffstat (limited to 'Userland/Shell')
-rw-r--r--Userland/Shell/Builtin.cpp3
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) {