You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tubemq.apache.org by gx...@apache.org on 2020/09/15 11:46:22 UTC

[incubator-tubemq] 06/50: adjust code style

This is an automated email from the ASF dual-hosted git repository.

gxcheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tubemq.git

commit 5c216c942998fbabfc2de55935e7fe0f058fe139
Author: gosonzhang <go...@tencent.com>
AuthorDate: Wed Jul 1 17:33:09 2020 +0800

    adjust code style
---
 tubemq-client-twins/tubemq-client-cpp/src/client_config.cc | 6 ++----
 tubemq-client-twins/tubemq-client-cpp/src/utils.cc         | 8 ++++----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/tubemq-client-twins/tubemq-client-cpp/src/client_config.cc b/tubemq-client-twins/tubemq-client-cpp/src/client_config.cc
index b596d76..84d6721 100644
--- a/tubemq-client-twins/tubemq-client-cpp/src/client_config.cc
+++ b/tubemq-client-twins/tubemq-client-cpp/src/client_config.cc
@@ -352,8 +352,7 @@ bool ConsumerConfig::setGroupConsumeTarget(string& err_info, bool is_bound_consu
     // check topic_name info
     is_success = Utils::ValidString(err_info, itMap->first, 
                          false, true, true, config::kTopicNameMaxLength);  
-    if (!is_success)
-    {
+    if (!is_success) {
       stringstream ss;
       ss << "Check parameter subscribed_topic_and_filter_map error: topic ";
       ss << itMap->first;
@@ -365,8 +364,7 @@ bool ConsumerConfig::setGroupConsumeTarget(string& err_info, bool is_bound_consu
     string topic_name = Utils::Trim(itMap->first);
     // check filter info
     set<string> subscribed_filters = itMap->second;
-    for (set<string>::iterator it = subscribed_filters.begin(); it != subscribed_filters.end(); ++it)
-    {
+    for (set<string>::iterator it = subscribed_filters.begin(); it != subscribed_filters.end(); ++it) {
       is_success = Utils::ValidFilterItem(err_info, *it, tmp_filteritem);
       if (!is_success) {
         stringstream ss;
diff --git a/tubemq-client-twins/tubemq-client-cpp/src/utils.cc b/tubemq-client-twins/tubemq-client-cpp/src/utils.cc
index d3f36ff..f9a1b1e 100644
--- a/tubemq-client-twins/tubemq-client-cpp/src/utils.cc
+++ b/tubemq-client-twins/tubemq-client-cpp/src/utils.cc
@@ -51,7 +51,7 @@ void Utils::Split(const string& source, vector<string>& result, const string& de
   if (!source.empty()) {
     pos1 = 0;
     pos2 = source.find(delimiter);
-    while(string::npos != pos2) {
+    while (string::npos != pos2) {
       item_str = Utils::Trim(source.substr(pos1, pos2-pos1));
       pos1 = pos2 + delimiter.size();
       pos2 = source.find(delimiter, pos1);
@@ -79,7 +79,7 @@ void Utils::Split(const string& source, map<string, int>& result,
   if (!source.empty()) {
     pos1 = 0;
     pos2 = source.find(delimiter_step1);
-    while(string::npos != pos2) {
+    while (string::npos != pos2) {
       item_str = source.substr(pos1, pos2-pos1);
       item_str = Utils::Trim(item_str);
       pos1 = pos2 + delimiter_step1.length();
@@ -229,8 +229,8 @@ bool Utils::ValidFilterItem(string& err_info,
   int status = regexec(&reg, tgt_filteritem.c_str(), 1, pmatch, 0);
   regfree(&reg);
   if (status == REG_NOMATCH) {
-      err_info = "value only contain characters,numbers,and underscores";
-      return false;
+    err_info = "value only contain characters,numbers,and underscores";
+    return false;
   }
   err_info = "Ok";
   return true;