Repository: mesos
Updated Branches:
  refs/heads/master 70bddc989 -> aa643b620


Simplify the comparison logic for `ExecutorInfo`.

This is a follow up fix of https://reviews.apache.org/r/52817/.

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


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

Branch: refs/heads/master
Commit: aa643b620e808347a552a19f90b6b311a1ec9732
Parents: 70bddc9
Author: haosdent huang <haosd...@gmail.com>
Authored: Tue Oct 18 16:28:44 2016 -0700
Committer: Vinod Kone <vinodk...@gmail.com>
Committed: Tue Oct 18 16:29:00 2016 -0700

----------------------------------------------------------------------
 src/common/type_utils.cpp | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/aa643b62/src/common/type_utils.cpp
----------------------------------------------------------------------
diff --git a/src/common/type_utils.cpp b/src/common/type_utils.cpp
index c6cf4f1..e249fae 100644
--- a/src/common/type_utils.cpp
+++ b/src/common/type_utils.cpp
@@ -318,13 +318,8 @@ bool operator==(const DiscoveryInfo& left, const 
DiscoveryInfo& right)
 
 bool operator==(const ExecutorInfo& left, const ExecutorInfo& right)
 {
-  if (left.has_type() && right.has_type()) {
-    if (left.type() != right.type()) {
-      return false;
-    }
-  }
-
   return left.has_type() == right.has_type() &&
+    (!left.has_type() || left.type() == right.type()) &&
     left.executor_id() == right.executor_id() &&
     left.data() == right.data() &&
     Resources(left.resources()) == Resources(right.resources()) &&

Reply via email to