Avoid repeated work in AttackBase.

- Avoid enumerating the collection more than once in a method as it is not trivial.