Drop all the calls to .keys() when iterating on the keys of a dict
authorPierre-Yves Chibon <pingou@pingoured.fr>
Tue, 28 Jul 2015 11:19:49 +0000 (11:19 +0000)
committerPatrick Uiterwijk <puiterwijk@redhat.com>
Tue, 11 Aug 2015 10:08:50 +0000 (12:08 +0200)
commitce2bbec3f2a010cfa26363a91a6224efe484f06f
tree0195f3654105f7a1e6b72743322c024c4717718b
parentdb9da225bce11ddeef1b5a2d511f18e17a808f15
Drop all the calls to .keys() when iterating on the keys of a dict

When browsing the keys of a dictionary, you can use the ``.keys()`` method but
that is in fact only really useful if you want to store the list of keys first
and act on them (like sorting them or so).
If you just want to iterate through all the keys, no matter the order, then it
is much much faster to just do: ``for key in dict``

Some stats about this can be found there:
http://blog.pingoured.fr/index.php?post/2012/03/12/Python-notes-to-self

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Reviewed-by: Simo Sorce <simo@redhat.com>
ipsilon/install/ipsilon-client-install
ipsilon/install/ipsilon-server-install
ipsilon/providers/saml2/rest.py
ipsilon/util/data.py
ipsilon/util/policy.py
tests/helpers/common.py
tests/testmapping.py
tests/testnameid.py