namespace {
#ifdef DEBUG
-map<Msp::GL::Tag, string> tag_names;
+map<Msp::GL::Tag, string> &get_tag_names()
+{
+ static map<Msp::GL::Tag, string> names;
+ return names;
+}
#endif
}
namespace GL {
Tag::Tag(const char *s):
- id((s && *s) ? hash32(s, strlen(s)) : 0)
+ id((s && *s) ? hash<32>(s, strlen(s)) : 0)
{
#ifdef DEBUG
if(s)
- tag_names.insert(make_pair(*this, string(s)));
+ get_tag_names().insert(make_pair(*this, string(s)));
#endif
}
Tag::Tag(const string &s):
- id(s.empty() ? 0 : hash32(s))
+ id(s.empty() ? 0 : hash<32>(s))
{
#ifdef DEBUG
if(!s.empty())
- tag_names.insert(make_pair(*this, s));
+ get_tag_names().insert(make_pair(*this, s));
#endif
}
string Tag::str() const
{
#ifdef DEBUG
- auto i=tag_names.find(*this);
- if(i!=tag_names.end())
+ const auto &names = get_tag_names();
+ auto i = names.find(*this);
+ if(i!=names.end())
return i->second;
#endif
return format("Tag(%d)", id);