Delete unnecessary code to reduce code size and improve maintainability by moving errorAngle initialisation to the conditional block where it is used.