I've attached a simple patch which removes some duplicate if conditionsthat seemed to have found their way into the code.
These are per PVS-Studio's warnings.
Regards
David Rowley