Purify some conditions for reducing redundancy codes. Test: manual Change-Id: I2f39207424f9db3fb6b12bc08bee525f3dfab0aa
6039c70261
11fb39a2f5