summaryrefslogtreecommitdiff
path: root/jam-files/boost-build/util/sequence.py
diff options
context:
space:
mode:
authorAvneesh Saluja <asaluja@gmail.com>2013-03-28 18:28:16 -0700
committerAvneesh Saluja <asaluja@gmail.com>2013-03-28 18:28:16 -0700
commit3d8d656fa7911524e0e6885647173474524e0784 (patch)
tree81b1ee2fcb67980376d03f0aa48e42e53abff222 /jam-files/boost-build/util/sequence.py
parentbe7f57fdd484e063775d7abf083b9fa4c403b610 (diff)
parent96fedabebafe7a38a6d5928be8fff767e411d705 (diff)
fixed conflicts
Diffstat (limited to 'jam-files/boost-build/util/sequence.py')
-rw-r--r--jam-files/boost-build/util/sequence.py50
1 files changed, 0 insertions, 50 deletions
diff --git a/jam-files/boost-build/util/sequence.py b/jam-files/boost-build/util/sequence.py
deleted file mode 100644
index 1d32efd2..00000000
--- a/jam-files/boost-build/util/sequence.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# (C) Copyright David Abrahams 2002. Permission to copy, use, modify, sell and
-# distribute this software is granted provided this copyright notice appears in
-# all copies. This software is provided "as is" without express or implied
-# warranty, and with no claim as to its suitability for any purpose.
-
-import operator
-
-def unique (values, stable=False):
- if stable:
- s = set()
- r = []
- for v in values:
- if not v in s:
- r.append(v)
- s.add(v)
- return r
- else:
- return list(set(values))
-
-def max_element (elements, ordered = None):
- """ Returns the maximum number in 'elements'. Uses 'ordered' for comparisons,
- or '<' is none is provided.
- """
- if not ordered: ordered = operator.lt
-
- max = elements [0]
- for e in elements [1:]:
- if ordered (max, e):
- max = e
-
- return max
-
-def select_highest_ranked (elements, ranks):
- """ Returns all of 'elements' for which corresponding element in parallel
- list 'rank' is equal to the maximum value in 'rank'.
- """
- if not elements:
- return []
-
- max_rank = max_element (ranks)
-
- result = []
- while elements:
- if ranks [0] == max_rank:
- result.append (elements [0])
-
- elements = elements [1:]
- ranks = ranks [1:]
-
- return result