Replaces a size == 0 check with an isEmpty() call.