Sort the return value from cpv_all() inside vardbapi._counter_hash() instead
authorZac Medico <zmedico@gentoo.org>
Wed, 12 Nov 2008 19:22:24 +0000 (19:22 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 12 Nov 2008 19:22:24 +0000 (19:22 -0000)
of sorting them in side cpv_all(). Thanks to Brian Harring for the suggestion.

svn path=/main/trunk/; revision=11865

pym/portage/dbapi/vartree.py

index c3628491dd616dbe1f0e3c7f03de4e21c20bf577..d8e676e8cf7f998cf14e66add63f7e7eab2e643e 100644 (file)
@@ -780,7 +780,9 @@ class vardbapi(dbapi):
                        from md5 import new as new_hash
                h = new_hash()
                aux_keys = ["COUNTER"]
-               for cpv in self.cpv_all():
+               cpv_list = self.cpv_all()
+               cpv_list.sort()
+               for cpv in cpv_list:
                        try:
                                counter, = self.aux_get(cpv, aux_keys)
                        except KeyError:
@@ -931,7 +933,7 @@ class vardbapi(dbapi):
                                        self.invalidentry(self.getpath(subpath))
                                        continue
                                returnme.append(subpath)
-               returnme.sort()
+
                return returnme
 
        def cp_all(self, use_cache=1):