A NULL iterator is not portable.

Trying to return a NULL iterator on failure is not portable. It is
better to assert since we have already verified that a parameter
should exist.
This commit is contained in:
Cary R 2010-05-17 09:25:02 -07:00 committed by Stephen Williams
parent 80bf64fc27
commit 22f91d2d34
1 changed files with 5 additions and 5 deletions

View File

@ -228,14 +228,14 @@ map<perm_string,NetScope::param_expr_t>::iterator NetScope::find_parameter(perm_
map<perm_string,param_expr_t>::iterator idx;
idx = parameters.find(key);
if (idx != parameters.end())
return idx;
if (idx != parameters.end()) return idx;
idx = localparams.find(perm_string::literal(key));
if (idx != localparams.end())
return idx;
if (idx != localparams.end()) return idx;
return (map<perm_string,param_expr_t>::iterator) 0;
// To get here the parameter must already exist, so we should
// never get here.
assert(0);
}
NetScope::TYPE NetScope::type() const