Broaden the early-out test for nsmallest and nlargest