Avoid a use of foreach where the container is a rvalue...

...(from utils::split) by using a local var to hold the value, since
apparently it can break on some compilers (sunpro) and such constructs
seem to not be used elsewhere in the code.
This commit is contained in:
Tomasz Śniatowski 2009-03-23 23:54:27 +01:00
parent c218d154e8
commit cf2fa93f64

View file

@ -553,7 +553,8 @@ void unit_animation::add_anims( std::vector<unit_animation> & animations, const
}
else
{
foreach (const std::string &hit_type, utils::split(anim["hits"]))
std::vector<std::string> v = utils::split(anim["hits"]);
foreach (const std::string &hit_type, v)
{
config tmp = anim;
tmp["hits"] = hit_type;