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:35 UTC

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

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);
       }