File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,24 +36,25 @@ class McrouterManager {
3636 const McrouterOptions& options,
3737 std::shared_ptr<folly::IOThreadPoolExecutorBase> ioThreadPool = nullptr ) {
3838 std::shared_ptr<CarbonRouterInstanceBase> mcrouterBase;
39+ auto persistenceIdStr = persistenceId.str ();
3940
4041 {
4142 std::lock_guard<std::mutex> lg (mutex_);
42- mcrouterBase = folly::get_default (mcrouters_, persistenceId. str () );
43+ mcrouterBase = folly::get_default (mcrouters_, persistenceIdStr );
4344 }
4445 if (!mcrouterBase) {
4546 std::lock_guard<std::mutex> ilg (initMutex_);
4647 {
4748 std::lock_guard<std::mutex> lg (mutex_);
48- mcrouterBase = folly::get_default (mcrouters_, persistenceId. str () );
49+ mcrouterBase = folly::get_default (mcrouters_, persistenceIdStr );
4950 }
5051 if (!mcrouterBase) {
5152 std::shared_ptr<CarbonRouterInstance<RouterInfo>> mcrouter =
5253 CarbonRouterInstance<RouterInfo>::create (
5354 options.clone (), std::move (ioThreadPool));
5455 if (mcrouter) {
5556 std::lock_guard<std::mutex> lg (mutex_);
56- mcrouters_[persistenceId. str ( )] = mcrouter;
57+ mcrouters_[std::move (persistenceIdStr )] = mcrouter;
5758 return mcrouter.get ();
5859 }
5960 }
You can’t perform that action at this time.
0 commit comments