Thread (14 messages) flat view 14 messages, 4 authors, 2016-06-15

Re: [PATCH 1/5] Introduces for_each_revision() helper

From: Alex Riesen <hidden>
Date: 2016-06-15 22:43:07

Johannes Schindelin, Sat, Apr 28, 2007 04:46:41 +0200:
quoted
+#define for_each_revision(commit, rev) \
+	for (prepare_revision_walk(rev); \
+		  (commit = get_revision(rev)) != NULL; )
+
 #endif
I object to this, additionally to the magic argument that I agree to, on 
the grounds that it is actually wrong. The first iteration will work on an 
_uninitialized_ "commit" variable.
No, it wont. Check it. This code is correct.
Furthermore, it is not like it was a huge piece of code that is being 
replaced by a shortcut. There are better places to do some libification 
than this.
It is not about libification. It is plain readability issue.
Look at what list_for_each_* macros did to the source of Linux kernel.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help