[
https://issues.apache.org/jira/browse/GEODE-3288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16271323#comment-16271323
]
ASF GitHub Bot commented on GEODE-3288:
---------------------------------------
pivotal-jbarrett commented on a change in pull request #160: GEODE-3288:
Converts char* to std::string on public API.
URL: https://github.com/apache/geode-native/pull/160#discussion_r153877151
##########
File path: cppcache/src/PoolFactory.cpp
##########
@@ -271,24 +271,26 @@ std::shared_ptr<Pool> PoolFactory::create(const char*
name) {
if (copyAttrs
->getThreadLocalConnectionSetting() /*&&
!copyAttrs->getPRSingleHopEnabled()*/) {
// TODO: what should we do for sticky connections
- poolDM =
- std::make_shared<ThinClientPoolStickyDM>(name, copyAttrs, tccm);
+ poolDM = std::make_shared<ThinClientPoolStickyDM>(name.c_str(),
+ copyAttrs, tccm);
} else {
LOGDEBUG("ThinClientPoolDM created ");
- poolDM = std::make_shared<ThinClientPoolDM>(name, copyAttrs, tccm);
+ poolDM =
+ std::make_shared<ThinClientPoolDM>(name.c_str(), copyAttrs, tccm);
}
} else {
LOGDEBUG("ThinClientPoolHADM created ");
if (copyAttrs
->getThreadLocalConnectionSetting() /*&&
!copyAttrs->getPRSingleHopEnabled()*/) {
- poolDM =
- std::make_shared<ThinClientPoolStickyHADM>(name, copyAttrs, tccm);
+ poolDM = std::make_shared<ThinClientPoolStickyHADM>(name.c_str(),
+ copyAttrs, tccm);
} else {
- poolDM = std::make_shared<ThinClientPoolHADM>(name, copyAttrs, tccm);
+ poolDM =
+ std::make_shared<ThinClientPoolHADM>(name.c_str(), copyAttrs,
tccm);
}
}
- cacheImpl->getPoolManager().addPool(name,
+ cacheImpl->getPoolManager().addPool(std::move(name),
Review comment:
Why not? The method is `PoolFactory::create(std::string name)` so I am
moving the already copied value into the member variable, rather than another
copy. Saves the copy of the underlying `char[]`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Replace char* with std::string
> ------------------------------
>
> Key: GEODE-3288
> URL: https://issues.apache.org/jira/browse/GEODE-3288
> Project: Geode
> Issue Type: Improvement
> Components: native client
> Reporter: Ernest Burghardt
>
> In all public API headers
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)