MCPcopy Create free account
hub / github.com/OpenCCU/OpenCCU / _ordered_unique

Function _ordered_unique

buildroot-external/scripts/kconfiglib.py:6384–6391  ·  view source on GitHub ↗
(lst)

Source from the content-addressed store, hash-verified

6382
6383
6384def _ordered_unique(lst):
6385 # Returns 'lst' with any duplicates removed, preserving order. This hacky
6386 # version seems to be a common idiom. It relies on short-circuit evaluation
6387 # and set.add() returning None, which is falsy.
6388
6389 seen = set()
6390 seen_add = seen.add
6391 return [x for x in lst if x not in seen and not seen_add(x)]
6392
6393
6394def _is_base_n(s, n):

Callers 1

_initMethod · 0.85

Calls 1

setFunction · 0.50

Tested by

no test coverage detected