This moves listview.count to evaluate last, taking the early out if possible. (cherry picked from commit dfee2cf4)