You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/07/07 20:02:35 UTC

[GitHub] [geode-native] mreddington commented on a change in pull request #830: GEODE-8891: Make static regex a Meyers Singleton in ThinClientRegion

mreddington commented on a change in pull request #830:
URL: https://github.com/apache/geode-native/pull/830#discussion_r665669483



##########
File path: cppcache/src/ThinClientRegion.cpp
##########
@@ -589,7 +595,7 @@ std::shared_ptr<SelectResults> ThinClientRegion::query(
   }
 
   std::string squery;
-  if (std::regex_search(predicate, PREDICATE_IS_FULL_QUERY_REGEX)) {
+  if (std::regex_search(predicate, IsFullQueryRegex::instance())) {

Review comment:
       Why wrap the static const in a singleton? That sounds like an even more complicated solution. You could have just made this regex a local const variable. Who cares about runtime performance when this isn't where we're slow? The class still needs to be initialized at runtime anyway, as you've found out the hard way, and instead of burdening the whole test harness with the initialization of a global static, you could isolate that initialization to the instantiation of this test when it's ran.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

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