From: Jay Freeman (saurik) Date: Sun, 3 Jan 2016 09:53:19 +0000 (-0800) Subject: Have console pre-initialize engine to feel faster. X-Git-Tag: v0.9.590~86 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/80fe26a61e165b7456274d6cc52ae40cb53b5c13?ds=inline Have console pre-initialize engine to feel faster. --- 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); } }