You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/11/22 13:00:43 UTC

[GitHub] [incubator-doris] imay commented on a change in pull request #2277: Replace boost::split() with strings::Split() in options

imay commented on a change in pull request #2277: Replace boost::split() with strings::Split() in options
URL: https://github.com/apache/incubator-doris/pull/2277#discussion_r349580861
 
 

 ##########
 File path: be/src/olap/options.cpp
 ##########
 @@ -45,30 +55,35 @@ OLAPStatus parse_root_path(const std::string& root_path, StorePath* path) {
         path->path = tmp_vec[0];
 
         // parse root path capacity and storage medium
-        std::string capacity_str, medium_str;
+        std::string capacity_str;
+        std::string medium_str;
 
         boost::filesystem::path boost_path = tmp_vec[0];
-        std::string extension =
-            boost::filesystem::canonical(boost_path).extension().string();
+        std::string extension = boost::filesystem::canonical(boost_path).extension().string();
         if (!extension.empty()) {
             medium_str = extension.substr(1);
         }
 
         for (int i = 1; i < tmp_vec.size(); i++) {
             // <property>:<value> or <value>
-            std::string property, value;
-            std::size_t found = tmp_vec[i].find(':');
-            if (found != std::string::npos) {
-                property = boost::trim_copy(tmp_vec[i].substr(0, found));
-                value = boost::trim_copy(tmp_vec[i].substr(found + 1));
+            std::string property;
+            std::string value;
+            std::pair<std::string, std::string> pair = strings::Split(
+                    tmp_vec[i], strings::delimiter::Limit(":", 1));
+            if (!pair.second.empty()) {
+                property = pair.first;
 
 Review comment:
   
   ```suggestion
                   property = to_upper(pari.first);
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org