Removing an unnecessary if statement