You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/06/21 10:25:29 UTC

[GitHub] [incubator-kvrocks] PragmaTwice commented on a diff in pull request #644: Refactor Trim/Split/Split2KV functions in util.h

PragmaTwice commented on code in PR #644:
URL: https://github.com/apache/incubator-kvrocks/pull/644#discussion_r902440112


##########
src/util.cc:
##########
@@ -371,7 +371,14 @@ std::string Trim(std::string in, const std::string &chars) {
 std::vector<std::string> Split(const std::string &in, const std::string &delim) {
   std::vector<std::string> out;
 
-  if (in.empty() || delim.empty()) return out;
+  if (in.empty()) {
+    return out;
+  }
+
+  if (delim.empty()) {

Review Comment:
   Thanks, I'll fix it.
   BTW, this function has some difference than some well known `split`: it split strings regarding to regex "a|b|c|..." where delim="abc...", so I am considering to add another split that split strings just regarding to the provided delimiter.



-- 
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: issues-unsubscribe@kvrocks.apache.org

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