diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2015-11-04 18:09:59 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2015-11-12 15:16:06 -0800 |
commit | 55662eca696352b5bbe2a0c31868b6ebb33e1c99 (patch) | |
tree | aff710de7b2017e7ee71b8c7a8fcc630b63e124e /lib/spack/llnl/util/lang.py | |
parent | 6dff42be0973c5949d836eab51cfdffb0eda0a69 (diff) | |
parent | 1c4ef2996219a00e774baafa558880c83ae3d859 (diff) | |
download | spack-55662eca696352b5bbe2a0c31868b6ebb33e1c99.tar.gz spack-55662eca696352b5bbe2a0c31868b6ebb33e1c99.tar.bz2 spack-55662eca696352b5bbe2a0c31868b6ebb33e1c99.tar.xz spack-55662eca696352b5bbe2a0c31868b6ebb33e1c99.zip |
Merge branch 'develop' into mplegendre-multi_pkgsrc_roots
Conflicts:
lib/spack/spack/__init__.py
lib/spack/spack/directives.py
lib/spack/spack/packages.py
Diffstat (limited to 'lib/spack/llnl/util/lang.py')
-rw-r--r-- | lib/spack/llnl/util/lang.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/spack/llnl/util/lang.py b/lib/spack/llnl/util/lang.py index be6dad867e..108fa98b36 100644 --- a/lib/spack/llnl/util/lang.py +++ b/lib/spack/llnl/util/lang.py @@ -88,10 +88,7 @@ def index_by(objects, *funcs): result = {} for o in objects: key = f(o) - if key not in result: - result[key] = [o] - else: - result[key].append(o) + result.setdefault(key, []).append(o) for key, objects in result.items(): result[key] = index_by(objects, *funcs[1:]) |