From a7f88575a8f1b7a43c913cf04f53e9b01497b041 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 4 Apr 2019 05:47:17 +0800 Subject: [PATCH] fixup! src: port bootstrap/cache.js to C++ --- src/node_native_module.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/node_native_module.cc b/src/node_native_module.cc index b5c1430e45d036..08c0ab16e3d8fa 100644 --- a/src/node_native_module.cc +++ b/src/node_native_module.cc @@ -42,11 +42,12 @@ void NativeModuleLoader::InitializeModuleCategories() { return; } - std::set prefixes = { + std::vector prefixes = { #if !HAVE_OPENSSL "internal/crypto/", #endif // !HAVE_OPENSSL + "internal/bootstrap/", "internal/per_context/", "internal/deps/", "internal/main/" @@ -80,9 +81,6 @@ void NativeModuleLoader::InitializeModuleCategories() { "internal/test/binding", "internal/v8_prof_polyfill", "internal/v8_prof_processor", - "internal/bootstrap/loaders", - "internal/bootstrap/node", - "internal/bootstrap/primordials" }; for (auto const& x : source_) { @@ -99,8 +97,7 @@ void NativeModuleLoader::InitializeModuleCategories() { for (auto const& x : source_) { const std::string& id = x.first; - if (module_categories_.cannot_be_required.find(id) == - module_categories_.cannot_be_required.end()) { + if (0 == module_categories_.cannot_be_required.count(id)) { module_categories_.can_be_required.emplace(id); } }