Don't deepcopy the config if the old value is not needed
authorKlaus Aehlig <aehlig@google.com>
Mon, 14 Dec 2015 14:08:22 +0000 (15:08 +0100)
committerKlaus Aehlig <aehlig@google.com>
Wed, 16 Dec 2015 17:00:07 +0000 (18:00 +0100)
commitd262bf74fa30d62ffd7e3fafb6c906a70cbd9f39
tree002946b040d0914902ed20cf77266dd0ee145f32
parent003cd9a8bd8d36b24a481a304492ec49efbd5b6d
Don't deepcopy the config if the old value is not needed

The _UpgradeConfig function carries out internal upgrades of the
configuration, and additionally, if requested, saves the configuration
in case it changed in this process. To compare the old and the new
version, a deep copy of the old version is kept. As deep copying large
configurations is an expensive operation, only do it, if the value is
used afterwards.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Lisa Velden <velden@google.com>
lib/config/__init__.py