locking.LockSet: don't modify input arguments
authorIustin Pop <iustin@google.com>
Thu, 29 Jan 2009 15:08:46 +0000 (15:08 +0000)
committerIustin Pop <iustin@google.com>
Thu, 29 Jan 2009 15:08:46 +0000 (15:08 +0000)
commit2a21bc88b10ff8476450c1816e86efd4d834b915
tree5d5ad042a78ea0dc57ebec00b500c264fb6091e5
parentf12eadb345d80b51c0aa667b0e7cf62d97925448
locking.LockSet: don't modify input arguments

Currently LockSet.acquire() sorts in place it's input argument if it's a
list. This is not good, since callers might depend on a specific
ordering of the input data, and this is a 'hidden' modification.

We fix it by simply using a sorted copy, instead of sorting in place.

Reviewed-by: ultrotter
lib/locking.py