Update return statement

Wed, 01 Feb 2017 10:51:00 +0100

author
David Demelier <markand@malikania.fr>
date
Wed, 01 Feb 2017 10:51:00 +0100
changeset 1
9bf9b4634339
parent 0
a8462a503697
child 2
1e34b51d9c52

Update return statement

STYLE_CPP.md file | annotate | diff | comparison | revisions
--- a/STYLE_CPP.md	Tue Jan 31 21:51:25 2017 +0100
+++ b/STYLE_CPP.md	Wed Feb 01 10:51:00 2017 +0100
@@ -308,7 +308,8 @@
 
     if (a_condition_is_not_valid) {
         return nullptr;
-    } else if (an_other_condition) {
+    }
+    if (an_other_condition) {
         return nullptr;
     }
 
@@ -319,4 +320,7 @@
 
     return x;
 
-Do never put parentheses between the returned value.
+Additional rules:
+
+  - Do never put parentheses between the returned value,
+  - Do not put a else branch after a return.

mercurial