Repository: mesos
Updated Branches:
  refs/heads/master 1bc3b913e -> 001c55c30


Replaced unchecked `dynamic_cast` with `static_cast`.

`Process` is a CRTP class where `T` must be a valid derived class.
Also, it is customary to use `static_cast` for CRTP methods.

This change uses a `static_cast` instead of a `dynamic_cast`.
`dynamic_cast` can result in a `nullptr` which should be checked.
Here this is not required, so `static_cast` is good enough.

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


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

Branch: refs/heads/master
Commit: 001c55c3061ef70470d09f41853c9adc8eab2ef5
Parents: 1bc3b91
Author: Benjamin Bannier <benjamin.bann...@mesosphere.io>
Authored: Tue Sep 20 14:38:26 2016 +0200
Committer: Michael Park <mp...@apache.org>
Committed: Tue Sep 20 15:56:24 2016 +0200

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/process.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/001c55c3/3rdparty/libprocess/include/process/process.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/process.hpp 
b/3rdparty/libprocess/include/process/process.hpp
index 54c7d2e..f389d3d 100644
--- a/3rdparty/libprocess/include/process/process.hpp
+++ b/3rdparty/libprocess/include/process/process.hpp
@@ -467,7 +467,7 @@ public:
    *
    * Valid even before calling spawn.
    */
-  PID<T> self() const { return PID<T>(dynamic_cast<const T*>(this)); }
+  PID<T> self() const { return PID<T>(static_cast<const T*>(this)); }
 
 protected:
   // Useful typedefs for dispatch/delay/defer to self()/this.

Reply via email to