[
https://issues.apache.org/jira/browse/GEODE-3288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16271343#comment-16271343
]
ASF GitHub Bot commented on GEODE-3288:
---------------------------------------
dgkimura 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_r153881855
##########
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:
I feel like it makes it just a little easier to shoot ourselves in the foot
(e.g. accidentally editing to use name after this line). Also since
`PoolFactory::create` probably won't be called in a tight loop a copy doesn't
seem too terrible?
----------------------------------------------------------------
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)