hashicorp/terraform — pull request #422 by svanharmelen (2014-10-16 09:55:47+00:00)
Title: Shaving off some unneeded calls, saving CPU cycles

I know it’s very unlikely that a user will notice the difference, but
why range through the list, generate the set and calculate the
hashcode, only to find out that indexMap == nil (e.g. don’t do anything
with the generated hashcode).

As indexMap is only needed when len(parts) > 0, why not only create and
fill it (in one go) when len(parts) > 0?