This commit is contained in:
Axel Kohlmeyer
2025-01-09 14:47:20 -05:00
parent b1e881d4ff
commit 12b6b797b8

View File

@ -656,11 +656,8 @@ int Group::find_unused()
int Group::get_bitmask_by_id(const std::string &file, int line, const std::string &name,
const std::string &caller)
{
int igroup = 0;
for (; igroup < MAX_GROUP; ++igroup) {
if (names[igroup] && (name == names[igroup])) break;
}
if (igroup == MAX_GROUP)
int igroup = find(name);
if (igroup < 0)
error->all(file, line, "Group ID {} requested by {} does not exist", name, caller);
return bitmask[igroup];
}