Skip to content

Commit 57f0583

Browse files
committed
optimize
Signed-off-by: Kuat Yessenov <[email protected]>
1 parent 92481f9 commit 57f0583

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/wasm.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ bool WasmHandleBase::canary(const std::shared_ptr<PluginBase> &plugin,
472472
if (this->wasm() == nullptr) {
473473
return false;
474474
}
475-
auto it = plugin_canary_cache_.find(plugin->key());
475+
std::string plugin_key(plugin->key());
476+
auto it = plugin_canary_cache_.find(plugin_key);
476477
if (it != plugin_canary_cache_.end()) {
477478
return it->second;
478479
}
@@ -494,11 +495,11 @@ bool WasmHandleBase::canary(const std::shared_ptr<PluginBase> &plugin,
494495
if (!configuration_canary_handle->wasm()->configure(root_context, plugin)) {
495496
configuration_canary_handle->wasm()->fail(FailState::ConfigureFailed,
496497
"Failed to configure base Wasm plugin");
497-
plugin_canary_cache_[plugin->key()] = false;
498+
plugin_canary_cache_[plugin_key] = false;
498499
return false;
499500
}
500501
configuration_canary_handle->kill();
501-
plugin_canary_cache_[plugin->key()] = true;
502+
plugin_canary_cache_[plugin_key] = true;
502503
return true;
503504
}
504505

0 commit comments

Comments
 (0)