improved record searching

pull/17/head
Marc Zinnschlag 15 years ago
parent 0414d7f862
commit 9a2f128f58

@ -50,9 +50,13 @@ namespace ESMS
const X* search(const std::string &id) const
{
std::string id2 = toLower (id);
if(list.find(id2) == list.end())
typename MapType::const_iterator iter = list.find (id2);
if (iter == list.end())
return NULL;
return &list.find(id2)->second;
return &iter->second;
}
// Find the given object ID (throws an exception if not found)
@ -88,9 +92,12 @@ namespace ESMS
const X* search(const std::string &id) const
{
std::string id2 = toLower (id);
if(list.find(id2) == list.end())
typename MapType::const_iterator iter = list.find (id2);
if (iter == list.end())
return NULL;
return &list.find(id2)->second;
return &iter->second;
}
// Find the given object ID (throws an exception if not found)
@ -130,9 +137,13 @@ namespace ESMS
const X* search(const std::string &id) const
{
std::string id2 = toLower (id);
if(list.find(id2) == list.end())
typename MapType::const_iterator iter = list.find (id2);
if (iter == list.end())
return NULL;
return &list.find(id2)->second;
return &iter->second;
}
// Find the given object ID (throws an exception if not found)
@ -289,9 +300,13 @@ namespace ESMS
const X* search(const std::string &id) const
{
std::string id2 = toLower (id);
if(list.find(id2) == list.end())
typename MapType::const_iterator iter = list.find (id2);
if (iter == list.end())
return NULL;
return &list.find(id2)->second;
return &iter->second;
}
// Find the given object ID (throws an exception if not found)
@ -331,10 +346,12 @@ namespace ESMS
// Find the given object ID, or return NULL if not found.
const X* search (int id) const
{
if (list.find (id) == list.end())
typename MapType::const_iterator iter = list.find (id);
if (iter == list.end())
return NULL;
return &list.find(id)->second;
return &iter->second;
}
// Find the given object ID (throws an exception if not found)

Loading…
Cancel
Save