Re: [PATCH] ext4: fix loop in do_split()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bill Davidsen
Date: Saturday, November 29, 2008 - 5:36 pm

roel kluin wrote:
While this unsigned wrap method is technically valid, it certainly isn't 
obvious, and making code readable should be a goal as well as making it correct. 
  After all, code which is hard to read is hard to understand, making it hard to 
maintain. I therefore suggest the simpler form:
	for (i = count; i--; ) {
which gives the same i values inside the loop, but does assume that the reader 
remembers that i is unsigned, and intuitively understand wraparound while 
passing zero.

-- 
Bill Davidsen <davidsen@tmr.com>
   "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] ext4: fix loop in do_split(), roel kluin, (Sat Nov 29, 2:36 am)
Re: [PATCH] ext4: fix loop in do_split(), Bill Davidsen, (Sat Nov 29, 5:36 pm)