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:
parent
80bf64fc27
commit
22f91d2d34
10
net_scope.cc
10
net_scope.cc
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue