Skip to content

Commit

Permalink
Removed unneeded Resources::add/remove(const Resource&).
Browse files Browse the repository at this point in the history
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
  • Loading branch information
xujyan committed Sep 13, 2016
1 parent 87e7088 commit c09214e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 40 deletions.
8 changes: 0 additions & 8 deletions include/mesos/resources.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,14 +500,6 @@ class Resources
// 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);
Expand Down
8 changes: 0 additions & 8 deletions include/mesos/v1/resources.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,14 +500,6 @@ class Resources
// 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);
Expand Down
12 changes: 0 additions & 12 deletions src/common/resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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()) {
Expand Down
12 changes: 0 additions & 12 deletions src/v1/resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit c09214e

Please sign in to comment.