pdxcodemonkey commented on a change in pull request #597:
URL: https://github.com/apache/geode-native/pull/597#discussion_r421069121



##########
File path: cppcache/src/CacheImpl.cpp
##########
@@ -640,13 +640,16 @@ void CacheImpl::readyForEvents() {
   }
 }
 
-bool CacheImpl::isPoolInMultiuserMode(std::shared_ptr<Region> regionPtr) {
-  const auto& poolName = regionPtr->getAttributes().getPoolName();
+bool CacheImpl::isPoolInMultiuserMode(std::shared_ptr<Region> region) {
+  const auto& poolName = region->getAttributes().getPoolName();
 
   if (!poolName.empty()) {
-    auto poolPtr = regionPtr->getCache().getPoolManager().find(poolName);
-    if (poolPtr != nullptr && !poolPtr->isDestroyed()) {
-      return poolPtr->getMultiuserAuthentication();
+    auto pool = static_cast<RegionInternal&>(*region)
+                    .getCacheImpl()
+                    ->getPoolManager()
+                    .find(poolName);
+    if (pool && !pool->isDestroyed()) {
+      return pool->getMultiuserAuthentication();

Review comment:
       Before I approve and merge this, can you explain why a method on 
CacheImpl is checking whether its pool is in multi-user mode by getting hold of 
_another_ CacheImpl pointer and extracting the pool from there?  Why can't 
CacheImpl call getPoolManager() on itself?  This code is super weird without 
any context...




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to