You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ne...@apache.org on 2017/05/25 17:08:55 UTC

[3/3] mesos git commit: Replaced "!(x == y)" with "x != y" when comparing SlaveIDs.

Replaced "!(x == y)" with "x != y" when comparing SlaveIDs.

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


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

Branch: refs/heads/master
Commit: 008607498d529a1b2dccaf37eb18ddd953470bee
Parents: 4a5ec22
Author: Neil Conway <ne...@gmail.com>
Authored: Thu May 25 10:01:59 2017 -0700
Committer: Neil Conway <ne...@gmail.com>
Committed: Thu May 25 10:03:01 2017 -0700

----------------------------------------------------------------------
 src/master/master.cpp | 2 +-
 src/slave/slave.cpp   | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/00860749/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 52544fb..14007e0 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5060,7 +5060,7 @@ void Master::kill(Framework* framework, const scheduler::Call::Kill& kill)
     return;
   }
 
-  if (slaveId.isSome() && !(slaveId.get() == task->slave_id())) {
+  if (slaveId.isSome() && slaveId.get() != task->slave_id()) {
     LOG(WARNING) << "Cannot kill task " << taskId << " of agent "
                  << slaveId.get() << " of framework " << *framework
                  << " because it belongs to different agent "

http://git-wip-us.apache.org/repos/asf/mesos/blob/00860749/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index dbc1c4b..b7e731b 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -1169,7 +1169,7 @@ void Slave::registered(
     }
     case RUNNING:
       // Already registered!
-      if (!(info.id() == slaveId)) {
+      if (info.id() != slaveId) {
        EXIT(EXIT_FAILURE)
          << "Registered but got wrong id: " << slaveId
          << " (expected: " << info.id() << "). Committing suicide";
@@ -1216,7 +1216,7 @@ void Slave::reregistered(
 
   CHECK_SOME(master);
 
-  if (!(info.id() == slaveId)) {
+  if (info.id() != slaveId) {
     EXIT(EXIT_FAILURE)
       << "Re-registered but got wrong id: " << slaveId
       << " (expected: " << info.id() << "). Committing suicide";
@@ -1618,7 +1618,7 @@ void Slave::run(
             << " for framework " << frameworkId;
 
   foreach (const TaskInfo& _task, tasks) {
-    if (!(_task.slave_id() == info.id())) {
+    if (_task.slave_id() != info.id()) {
       LOG(WARNING)
         << "Agent " << info.id() << " ignoring running "
         << taskOrTaskGroup(_task, taskGroup) << " because "
@@ -6005,7 +6005,7 @@ void Slave::__recover(const Future<Nothing>& future)
       // registers with the master) or if it is an old work directory.
       SlaveID slaveId;
       slaveId.set_value(entry);
-      if (!info.has_id() || !(slaveId == info.id())) {
+      if (!info.has_id() || slaveId != info.id()) {
         LOG(INFO) << "Garbage collecting old agent " << slaveId;
 
         // NOTE: We update the modification time of the slave work/meta