summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/rangehttpserver
diff options
context:
space:
mode:
authorpolykernel <81340136+polykernel@users.noreply.github.com>2021-11-01 00:16:52 -0400
committerpolykernel <81340136+polykernel@users.noreply.github.com>2021-11-01 16:29:01 -0400
commitcd6397519fe8f94fae3646050d8742b11e287bfa (patch)
tree1a7de29ff19814b4d28e803c425567299f7dca95 /pkgs/development/python-modules/rangehttpserver
parent509d236edf0056d05547c776140fe7cfcf2305bd (diff)
lib/lists: mutuallyExclusive function optimization
The current implementation of `mutuallyExclusive` builds a new list with length subtracted by one on every recursive call which is expensive. When b is empty, the function still traverses a in its entirety before returning a result. The new implementation uses `any` to check if each element of list b is in list a using `elem`. This maintains short circuiting when list a or b is empty and has a worst case time complexity of O(nm).
Diffstat (limited to 'pkgs/development/python-modules/rangehttpserver')
0 files changed, 0 insertions, 0 deletions