[gjs: 9/11] importer: Don't reinitialize search path every time




commit bef714f1e26c136123f075dd5f102b8862dd4e50
Author: Philip Chimento <philip chimento gmail com>
Date:   Tue Sep 28 23:27:32 2021 -0700

    importer: Don't reinitialize search path every time
    
    gjs_get_search_path() caches its expensive initialization, but due to
    never setting the search_path_initialized variable to true, the cache was
    never used and the initialization was repeated every time.

 gjs/importer.cpp | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 71713133..b7dfba95 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -809,6 +809,8 @@ JSFunctionSpec gjs_importer_proto_funcs[] = {
 #else
         gjs_search_path.push_back(GJS_JS_DIR);
 #endif
+
+        search_path_initialized = true;
     }
 
     return gjs_search_path;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]