From 29a9be650323ea3102219cd77a148c5022f65686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Musab=20K=C4=B1l=C4=B1=C3=A7?= Date: Fri, 27 Aug 2021 19:56:09 +0300 Subject: Shell: Add iteration_times.ensure_capacity() in builtin_time --- Userland/Shell/Builtin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Userland/Shell') 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 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) { -- cgit v1.2.3