mesos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jie Yu <yujie....@gmail.com>
Subject Re: [4/4] mesos git commit: Removed unnecesary break statements in local approver.
Date Tue, 11 Apr 2017 23:34:10 GMT
oops. I think I might break something. I don't know why this happened :(
Let me try to fix it.

On Tue, Apr 11, 2017 at 4:31 PM, <jieyu@apache.org> wrote:

> Removed unnecesary break statements in local approver.
>
> Removes `break` statements located in lines following a `return`
> statement since they are effectively unreachable code, don't improve
> readability nor make the code cleaner.
>
> Review: https://reviews.apache.org/r/58292/
>
>
> Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
> Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/76d42c3b
> Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/76d42c3b
> Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/76d42c3b
>
> Branch: refs/heads/master
> Commit: 76d42c3bb8404b68656dfff4ed31cff9750f3e65
> Parents: 8e15963
> Author: Alexander Rojas <alexander@mesosphere.io>
> Authored: Mon Apr 10 18:03:10 2017 -0700
> Committer: Jie Yu <yujie.jay@gmail.com>
> Committed: Tue Apr 11 16:31:06 2017 -0700
>
> ----------------------------------------------------------------------
>  src/common/validation.cpp | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/76d42c3b/
> src/common/validation.cpp
> ----------------------------------------------------------------------
> diff --git a/src/common/validation.cpp b/src/common/validation.cpp
> index 544d3a0..9c4f1de 100644
> --- a/src/common/validation.cpp
> +++ b/src/common/validation.cpp
> @@ -16,6 +16,8 @@
>
>  #include "common/validation.hpp"
>
> +#include <limits.h>
> +
>  #include <algorithm>
>  #include <cctype>
>
> @@ -37,13 +39,19 @@ Option<Error> validateID(const string& id)
>      return Error("ID must not be empty");
>    }
>
> +  if (id.length() > NAME_MAX) {
> +    return Error(
> +        "ID must not be greater than " +
> +        stringify(NAME_MAX) + " characters");
> +  }
> +
>    // The ID cannot be exactly these special path components.
>    if (id == "." || id == "..") {
>      return Error("'" + id + "' is disallowed");
>    }
>
>    // Rules on invalid characters in the ID:
> -  // - Control charaters are obviously not allowed.
> +  // - Control characters are obviously not allowed.
>    // - Slashes are disallowed as IDs are likely mapped to directories in
> Mesos.
>    auto invalidCharacter = [](char c) {
>      return iscntrl(c) ||
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message