summaryrefslogtreecommitdiff
path: root/site_scons
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-02-24 12:12:53 -0500
committerMathias Stearn <mathias@10gen.com>2017-02-28 11:58:12 -0500
commit1927810547c7af41bcbcb93a9822438d381ee3cd (patch)
tree048783e38613dc32e7c602e3f42b98d4580db828 /site_scons
parentd63633540dd66d7b1830a257fd178c2fd38272b9 (diff)
downloadmongo-1927810547c7af41bcbcb93a9822438d381ee3cd.tar.gz
SERVER-28099 Use key rather than cmp in libdeps.py sorted_by_str
From the python docs: "In general, the key and reverse conversion processes are much faster than specifying an equivalent cmp function. This is because cmp is called multiple times for each list element while key and reverse touch each element only once."
Diffstat (limited to 'site_scons')
-rw-r--r--site_scons/libdeps.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/site_scons/libdeps.py b/site_scons/libdeps.py
index c20eb881d0a..153c551290b 100644
--- a/site_scons/libdeps.py
+++ b/site_scons/libdeps.py
@@ -68,7 +68,7 @@ def sorted_by_str(iterable):
across invocations of SCons. Since dependency order changes force rebuilds,
we use this sort to create stable dependency orders.
"""
- return sorted(iterable, cmp=lambda lhs, rhs: cmp(str(lhs), str(rhs)))
+ return sorted(iterable, key=str)
class DependencyCycleError(SCons.Errors.UserError):
"""Exception representing a cycle discovered in library dependencies."""