You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2016/02/12 11:20:14 UTC

[4/5] mesos git commit: Renamed a parameter on strings::split for readability.

Renamed a parameter on strings::split for readability.


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e6fdd5de
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e6fdd5de
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e6fdd5de

Branch: refs/heads/master
Commit: e6fdd5de76ffdedf61458868484e82e3994450e3
Parents: 66ddbc7
Author: Benjamin Mahler <be...@gmail.com>
Authored: Thu Feb 11 13:39:52 2016 +0100
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Fri Feb 12 10:33:28 2016 +0100

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/stout/include/stout/strings.hpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e6fdd5de/3rdparty/libprocess/3rdparty/stout/include/stout/strings.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/strings.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/strings.hpp
index 1309a18..015eecd 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/strings.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/strings.hpp
@@ -169,12 +169,12 @@ inline std::vector<std::string> tokenize(
 inline std::vector<std::string> split(
     const std::string& s,
     const std::string& delims,
-    const Option<size_t>& n = None())
+    const Option<size_t>& maxTokens = None())
 {
   std::vector<std::string> tokens;
   size_t offset = 0;
 
-  while (n.isNone() || n.get() > 0) {
+  while (maxTokens.isNone() || maxTokens.get() > 0) {
     size_t next = s.find_first_of(delims, offset);
     if (next == std::string::npos) {
       tokens.push_back(s.substr(offset));
@@ -185,11 +185,12 @@ inline std::vector<std::string> split(
     offset = next + 1;
 
     // Finish splitting if we've found enough tokens.
-    if (n.isSome() && tokens.size() == n.get() - 1) {
+    if (maxTokens.isSome() && tokens.size() == maxTokens.get() - 1) {
       tokens.push_back(s.substr(offset));
       break;
     }
   }
+
   return tokens;
 }