[Minor code cleanup] Remove duplicated condition check