X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fanimation%2Farmature.cpp;h=acfffbf7b3cc2a53b9c1afb419842aac2b8e84c7;hb=a16145549dc87c3b12671f797bd77b14bcc7786b;hp=6e921e3f8e9ea95246b8dae655ba54f701d0689d;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git
diff --git a/source/animation/armature.cpp b/source/animation/armature.cpp
index 6e921e3f..acfffbf7 100644
--- a/source/animation/armature.cpp
+++ b/source/animation/armature.cpp
@@ -8,31 +8,31 @@ namespace GL {
Armature::Link &Armature::add_link()
{
- links.push_back(Link(string(), links.size()));
+ links.emplace_back(string(), links.size());
return links.back();
}
const Armature::Link &Armature::get_link(unsigned index) const
{
- for(vector::const_iterator i=links.begin(); i!=links.end(); ++i)
- if(i->get_index()==index)
- return *i;
- throw key_error(typeid(list));
+ for(const Link &l: links)
+ if(l.get_index()==index)
+ return l;
+ throw key_error(index);
}
const Armature::Link &Armature::get_link(const string &name) const
{
- for(vector::const_iterator i=links.begin(); i!=links.end(); ++i)
- if(i->get_name()==name)
- return *i;
- throw key_error(typeid(list));
+ for(const Link &l: links)
+ if(l.get_name()==name)
+ return l;
+ throw key_error(name);
}
unsigned Armature::get_max_link_index() const
{
unsigned max_index = 0;
- for(vector::const_iterator i=links.begin(); i!=links.end(); ++i)
- max_index = max(max_index, i->get_index());
+ for(const Link &l: links)
+ max_index = max(max_index, l.get_index());
return max_index;
}