From ce2bbec3f2a010cfa26363a91a6224efe484f06f Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Tue, 28 Jul 2015 11:19:49 +0000 Subject: 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 Reviewed-by: Simo Sorce --- ipsilon/install/ipsilon-server-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ipsilon/install/ipsilon-server-install') diff --git a/ipsilon/install/ipsilon-server-install b/ipsilon/install/ipsilon-server-install index 6c7c6dd..80bd274 100755 --- a/ipsilon/install/ipsilon-server-install +++ b/ipsilon/install/ipsilon-server-install @@ -313,7 +313,7 @@ def parse_config_profile(args): if g in globals(): globals()[g] = val else: - for k in globals().keys(): + for k in globals(): if k.lower() == g.lower(): globals()[k] = val break -- cgit