Move "empty interface" check into outer loop to improve performance.