From 86be305db88a525dfc44e0e42256e2530a9f2b77 Mon Sep 17 00:00:00 2001 From: zhangyi1357 <34409786+zhangyi1357@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:09:27 +0800 Subject: [PATCH] refactor: change string_view to string in LocalChannelBackend subscription index map (#124) Updated the SubscribeIndexMap in LocalChannelBackend to use std::string instead of std::string_view for msg_type, topic, lib_path, and module_name. This change enhances memory management and ensures proper ownership semantics for string data within the subscription index map. --- src/runtime/core/channel/local_channel_backend.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/core/channel/local_channel_backend.h b/src/runtime/core/channel/local_channel_backend.h index 907f561ce..0b53c48ef 100644 --- a/src/runtime/core/channel/local_channel_backend.h +++ b/src/runtime/core/channel/local_channel_backend.h @@ -67,13 +67,13 @@ class LocalChannelBackend : public ChannelBackendBase { using SubscribeIndexMap = std::unordered_map< - std::string_view, // msg_type + std::string, // msg_type std::unordered_map< - std::string_view, // topic + std::string, // topic std::unordered_map< - std::string_view, // lib_path + std::string, // lib_path std::unordered_set< - std::string_view>>>>; // module_name + std::string>>>>; // module_name SubscribeIndexMap subscribe_index_map_; };