From 99b59393fefc1191cb619d17f0d6d3d3f78492ae Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Sat, 14 Jan 2023 15:32:42 -0800 Subject: [PATCH] [init] Use a real std::unordered_map for the services map Now that ceil* works in libc, use std::unordered_map instead of util::node_map to store the protocol to service mapping. --- src/user/srv.init/service_locator.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/user/srv.init/service_locator.cpp b/src/user/srv.init/service_locator.cpp index c087cf8..90e30f0 100644 --- a/src/user/srv.init/service_locator.cpp +++ b/src/user/srv.init/service_locator.cpp @@ -21,7 +21,7 @@ void service_locator_start(j6_handle_t mb) { // TODO: This should be a multimap - util::node_map services; + std::unordered_map services; uint64_t tag = 0; uint64_t subtag = 0; @@ -64,11 +64,13 @@ service_locator_start(j6_handle_t mb) proto_id = subtag; tag = j6_proto_sl_result; - found = services.find(proto_id); - if (found) - give_handle = found->handle; - else - give_handle = j6_handle_invalid; + { + auto found = services.find(proto_id); + if (found != services.end()) + give_handle = found->second; + else + give_handle = j6_handle_invalid; + } break; default: