diff options
| author | Wolfram Strepp <[email protected]> | 2009-03-31 15:23:45 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2009-04-01 08:59:17 -0700 |
| commit | 55a63998b8967615a15e2211ba0ff3a84a565824 (patch) | |
| tree | a83905577b60496a3ea9174bf29596f927354746 /scripts/stackusage | |
| parent | 53d6660836f233df66490707365ab177e5fb2bb4 (diff) | |
lib/rbtree.c: optimize rb_erase()
Tfour 4 redundant if-conditions in function __rb_erase_color() in
lib/rbtree.c are removed.
In pseudo-source-code, the structure of the code is as follows:
if ((!A || B) && (!C || D)) {
.
.
.
} else {
if (!C || D) {//if this is true, it implies: (A == true) && (B == false)
if (A) {//hence this always evaluates to 'true'...
.
}
.
//at this point, C always becomes true, because of:
__rb_rotate_right/left();
//and:
other = parent->rb_right/left;
}
.
.
if (C) {//...and this too !
.
}
}
Signed-off-by: Wolfram Strepp <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions