]> git.ipfire.org Git - thirdparty/mdadm.git/commit - Assemble.c
Assemble: merge to large 'if' statements.
authorNeilBrown <neilb@suse.de>
Mon, 22 Nov 2010 09:58:05 +0000 (20:58 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 22 Nov 2010 09:58:05 +0000 (20:58 +1100)
commitbac0d92e931259a2d41be1b9fe779d39d5d011b7
tree7047ca75e8bc4abbc55371d85bc2ea93c353d21e
parenta655e5506478c540db06649fe7833c3c0982f80c
Assemble: merge to large 'if' statements.

In assemble, we see (inside a 'for' loop):

 if (condition) {
    lots of stuff
 } else
    something

 small thing

 if (same condition) {
     lots more stuff
     break;
 }

where 'condition' cannot be changed in the middle.

So simplify this to

 if (condition) {
    lots of stuff
    small thing
    lots more stuff
    break;
 }

 something
 small thing

which duplicates the small thing, but provides much
conceptual simplicity.

Signed-off-by: NeilBrown <neilb@suse.de>
Assemble.c