[LNT] r325074 - List compare is faster than list to tuple then compare
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 13 15:36:53 PST 2018
Author: cmatthews
Date: Tue Feb 13 15:36:53 2018
New Revision: 325074
URL: http://llvm.org/viewvc/llvm-project?rev=325074&view=rev
Log:
List compare is faster than list to tuple then compare
Even though tuple compare IS really fast.
Modified:
lnt/trunk/lnt/server/db/testsuitedb.py
Modified: lnt/trunk/lnt/server/db/testsuitedb.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/testsuitedb.py?rev=325074&r1=325073&r2=325074&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/testsuitedb.py (original)
+++ lnt/trunk/lnt/server/db/testsuitedb.py Tue Feb 13 15:36:53 2018
@@ -304,12 +304,11 @@ class TestSuiteDB(object):
# against non-instances.
if self.__class__ is not b.__class__:
return -1
-
# Compare every field in lexicographic order.
- return cmp(tuple(convert_revision(self.get_field(item), cache=Order.order_name_cache)
- for item in self.fields),
- tuple(convert_revision(b.get_field(item), cache=Order.order_name_cache)
- for item in self.fields))
+ return cmp([convert_revision(self.get_field(item), cache=Order.order_name_cache)
+ for item in self.fields],
+ [convert_revision(b.get_field(item), cache=Order.order_name_cache)
+ for item in self.fields])
def __json__(self, include_id=True):
result = {}
More information about the llvm-commits
mailing list