From 80fe26a61e165b7456274d6cc52ae40cb53b5c13 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 3 Jan 2016 01:53:19 -0800 Subject: [PATCH] Have console pre-initialize engine to feel faster. --- Console.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Console.cpp b/Console.cpp index 21566fe..7a9de20 100644 --- a/Console.cpp +++ b/Console.cpp @@ -607,6 +607,11 @@ static void CYConsolePrepTerm(int meta) { CYConsoleRemapKeys(vi_movement_keymap); } +static void CYOutputRun(const std::string &code, bool expand = false) { + CYPool pool; + Output(Run(pool, client_, code), &std::cout, expand); +} + static void Console(CYOptions &options) { std::string basedir; #ifdef __ANDROID__ @@ -647,6 +652,8 @@ static void Console(CYOptions &options) { rl_prep_term_function = CYConsolePrepTerm; } + CYOutputRun(""); + struct sigaction action; sigemptyset(&action.sa_mask); action.sa_handler = &sigint; @@ -768,8 +775,7 @@ static void Console(CYOptions &options) { std::cout << std::endl; } - CYPool pool; - Output(Run(pool, client_, code), &std::cout, expand); + CYOutputRun(code, expand); } } -- 2.49.0