]> git.saurik.com Git - cycript.git/commitdiff
Have console pre-initialize engine to feel faster.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 3 Jan 2016 09:53:19 +0000 (01:53 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 3 Jan 2016 09:53:19 +0000 (01:53 -0800)
Console.cpp

index 21566fe21d8f0ffa923d3aed3fa38752ab2387a6..7a9de2085414c2e5664cba0b44d046600228248a 100644 (file)
@@ -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);
     }
 }