Repository: mesos
Updated Branches:
  refs/heads/master 87e70888e -> c09214e52


Removed unneeded `Resources::add/remove(const Resource&)`.

We can remove these given that they already call
`Resources::add/remove(const Resource_&)` internally and
a Resource is implicitly convertible to a Resource_.

Review: https://reviews.apache.org/r/51850


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

Branch: refs/heads/master
Commit: c09214e52abe92e648b933d61c8a6b820a2036c6
Parents: 87e7088
Author: Jiang Yan Xu <xuj...@apple.com>
Authored: Tue Sep 6 14:26:28 2016 -0700
Committer: Jiang Yan Xu <xuj...@apple.com>
Committed: Tue Sep 13 16:06:33 2016 -0700

----------------------------------------------------------------------
 include/mesos/resources.hpp    |  8 --------
 include/mesos/v1/resources.hpp |  8 --------
 src/common/resources.cpp       | 12 ------------
 src/v1/resources.cpp           | 12 ------------
 4 files changed, 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c09214e5/include/mesos/resources.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/resources.hpp b/include/mesos/resources.hpp
index 87828aa..7ba422d 100644
--- a/include/mesos/resources.hpp
+++ b/include/mesos/resources.hpp
@@ -500,14 +500,6 @@ private:
   // returns Resources.
   Option<Resources> find(const Resource& target) const;
 
-  // Validation-free versions of += and -= `Resource` operators.
-  // These can be used when `r` is already validated.
-  void add(const Resource& r);
-  void subtract(const Resource& r);
-
-  // The add and subtract methods and operators on Resource_ are only
-  // allowed from within Resources class so we hide them.
-
   // Validation-free versions of += and -= `Resource_` operators.
   // These can be used when `r` is already validated.
   void add(const Resource_& r);

http://git-wip-us.apache.org/repos/asf/mesos/blob/c09214e5/include/mesos/v1/resources.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/v1/resources.hpp b/include/mesos/v1/resources.hpp
index 27bdd27..add48c7 100644
--- a/include/mesos/v1/resources.hpp
+++ b/include/mesos/v1/resources.hpp
@@ -500,14 +500,6 @@ private:
   // returns Resources.
   Option<Resources> find(const Resource& target) const;
 
-  // Validation-free versions of += and -= `Resource` operators.
-  // These can be used when `r` is already validated.
-  void add(const Resource& r);
-  void subtract(const Resource& r);
-
-  // The add and subtract methods and operators on Resource_ are only
-  // allowed from within Resources class so we hide them.
-
   // Validation-free versions of += and -= `Resource_` operators.
   // These can be used when `r` is already validated.
   void add(const Resource_& r);

http://git-wip-us.apache.org/repos/asf/mesos/blob/c09214e5/src/common/resources.cpp
----------------------------------------------------------------------
diff --git a/src/common/resources.cpp b/src/common/resources.cpp
index 77ee921..f841e91 100644
--- a/src/common/resources.cpp
+++ b/src/common/resources.cpp
@@ -1597,12 +1597,6 @@ void Resources::add(const Resource_& that)
 }
 
 
-void Resources::add(const Resource& that)
-{
-  add(Resource_(that));
-}
-
-
 Resources& Resources::operator+=(const Resource_& that)
 {
   if (that.validate().isNone()) {
@@ -1695,12 +1689,6 @@ void Resources::subtract(const Resource_& that)
 }
 
 
-void Resources::subtract(const Resource& that)
-{
-  subtract(Resource_(that));
-}
-
-
 Resources& Resources::operator-=(const Resource_& that)
 {
   if (that.validate().isNone()) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c09214e5/src/v1/resources.cpp
----------------------------------------------------------------------
diff --git a/src/v1/resources.cpp b/src/v1/resources.cpp
index 4ba5bf8..4410a8f 100644
--- a/src/v1/resources.cpp
+++ b/src/v1/resources.cpp
@@ -1600,12 +1600,6 @@ void Resources::add(const Resource_& that)
 }
 
 
-void Resources::add(const Resource& that)
-{
-  add(Resource_(that));
-}
-
-
 Resources& Resources::operator+=(const Resource_& that)
 {
   if (that.validate().isNone()) {
@@ -1698,12 +1692,6 @@ void Resources::subtract(const Resource_& that)
 }
 
 
-void Resources::subtract(const Resource& that)
-{
-  subtract(Resource_(that));
-}
-
-
 Resources& Resources::operator-=(const Resource_& that)
 {
   if (that.validate().isNone()) {

Reply via email to