You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2015/09/02 00:00:34 UTC

[1/2] mesos git commit: Updated an implicit NULL check to be explicit.

Repository: mesos
Updated Branches:
  refs/heads/master 3e7758c8b -> 8f3955b54


Updated an implicit NULL check to be explicit.


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

Branch: refs/heads/master
Commit: 1208713887bef2e9e66dbd5efd85d54673ccf202
Parents: 3e7758c
Author: Benjamin Mahler <be...@gmail.com>
Authored: Tue Sep 1 14:59:36 2015 -0700
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Tue Sep 1 14:59:36 2015 -0700

----------------------------------------------------------------------
 src/linux/perf.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/12087138/src/linux/perf.cpp
----------------------------------------------------------------------
diff --git a/src/linux/perf.cpp b/src/linux/perf.cpp
index dac7061..beb6854 100644
--- a/src/linux/perf.cpp
+++ b/src/linux/perf.cpp
@@ -402,7 +402,8 @@ Try<hashmap<string, mesos::PerfStatistics>> parse(const string& output)
       statistics[cgroup].GetReflection();
     const google::protobuf::FieldDescriptor* field =
       statistics[cgroup].GetDescriptor()->FindFieldByName(event);
-    if (!field) {
+
+    if (field == NULL) {
       return Error("Unexpected perf output at line: " + line);
     }
 


[2/2] mesos git commit: Fixed switch case statment formatting in perf.cpp.

Posted by bm...@apache.org.
Fixed switch case statment formatting in perf.cpp.


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

Branch: refs/heads/master
Commit: 8f3955b54f54932e31a503c2b9fec29bf26f365a
Parents: 1208713
Author: Benjamin Mahler <be...@gmail.com>
Authored: Tue Sep 1 15:00:20 2015 -0700
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Tue Sep 1 15:00:20 2015 -0700

----------------------------------------------------------------------
 src/linux/perf.cpp | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/8f3955b5/src/linux/perf.cpp
----------------------------------------------------------------------
diff --git a/src/linux/perf.cpp b/src/linux/perf.cpp
index beb6854..a3a7f4c 100644
--- a/src/linux/perf.cpp
+++ b/src/linux/perf.cpp
@@ -413,30 +413,28 @@ Try<hashmap<string, mesos::PerfStatistics>> parse(const string& output)
     }
 
     switch (field->type()) {
-      case google::protobuf::FieldDescriptor::TYPE_DOUBLE:
-        {
-          Try<double> number =
-            (value == "<not counted>") ?  0 : numify<double>(value);
+      case google::protobuf::FieldDescriptor::TYPE_DOUBLE: {
+        Try<double> number =
+          (value == "<not counted>") ?  0 : numify<double>(value);
 
-          if (number.isError()) {
-            return Error("Unable to parse perf value at line: " + line);
-          }
-
-          reflection->SetDouble(&(statistics[cgroup]), field, number.get());
-          break;
+        if (number.isError()) {
+          return Error("Unable to parse perf value at line: " + line);
         }
-      case google::protobuf::FieldDescriptor::TYPE_UINT64:
-        {
-          Try<uint64_t> number =
-            (value == "<not counted>") ?  0 : numify<uint64_t>(value);
 
-          if (number.isError()) {
-            return Error("Unable to parse perf value at line: " + line);
-          }
+        reflection->SetDouble(&(statistics[cgroup]), field, number.get());
+        break;
+      }
+      case google::protobuf::FieldDescriptor::TYPE_UINT64: {
+        Try<uint64_t> number =
+            (value == "<not counted>") ?  0 : numify<uint64_t>(value);
 
-          reflection->SetUInt64(&(statistics[cgroup]), field, number.get());
-          break;
+        if (number.isError()) {
+          return Error("Unable to parse perf value at line: " + line);
         }
+
+        reflection->SetUInt64(&(statistics[cgroup]), field, number.get());
+        break;
+      }
       default:
         return Error("Unsupported perf field type at line: " + line);
       }