Don't sort the vector when it is empty. This should fix some expensive checking