correct the return value type

This commit is contained in:
Yaser Afshar
2021-09-03 14:51:19 -05:00
parent 257a7fe9ca
commit d4930df464

View File

@ -2079,19 +2079,17 @@ int Atom::add_label_map(const std::string &mapID)
int Atom::find_label(const std::string &label, int mode) int Atom::find_label(const std::string &label, int mode)
{ {
int ilmap = 0;
// check for auxiliary map prefix // check for auxiliary map prefix
int pos = label.find("::"); std::string::size_type pos = label.find("::");
if (pos != std::string::npos) { if (pos != std::string::npos) {
ilmap = find_labelmap(label.substr(0,pos)); int ilmap = find_labelmap(label.substr(0,pos));
if (ilmap == -1) return -1; if (ilmap == -1) return -1;
auto slabel = label.substr(pos+2); auto slabel = label.substr(pos+2);
return lmaps[ilmap]->find(slabel,mode); return lmaps[ilmap]->find(slabel,mode);
} }
return lmaps[ilmap]->find(label,mode); return lmaps[0]->find(label,mode);
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------