const-ify member function

This commit is contained in:
Vern Paxson 2021-11-22 10:55:38 -08:00
parent ffbbacd3b1
commit 735d584d9f
2 changed files with 2 additions and 2 deletions

View file

@ -186,7 +186,7 @@ public:
// Returns a mapping of from Attr objects to their associated
// initialization information. The Attr must have previously
// been registered.
auto& ProcessedAttr() { return processed_attr; }
auto& ProcessedAttr() const { return processed_attr; }
// True if the given expression is simple enough that we can
// generate code to evaluate it directly, and don't need to

View file

@ -309,7 +309,7 @@ AttrsInfo::AttrsInfo(CPPCompile* _c, const AttributesPtr& _attrs) : CompoundItem
for ( const auto& a : _attrs->GetAttrs() )
{
ASSERT(c->ProcessedAttr().count(a.get()) > 0);
auto gi = c->ProcessedAttr()[a.get()];
const auto& gi = c->ProcessedAttr().at(a.get());
init_cohort = max(init_cohort, gi->InitCohort() + 1);
vals.emplace_back(Fmt(gi->Offset()));
}