mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
tidying some interfaces
This commit is contained in:
parent
d9b67edf52
commit
a912f6dd9a
3 changed files with 4 additions and 4 deletions
|
@ -468,7 +468,7 @@ NameExpr::NameExpr(IDPtr arg_id, bool const_init)
|
|||
}
|
||||
|
||||
// This isn't in-lined to avoid needing to pull in ID.h.
|
||||
IDPtr NameExpr::IdPtr()
|
||||
const IDPtr& NameExpr::IdPtr() const
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
|
|
@ -405,7 +405,7 @@ public:
|
|||
explicit NameExpr(IDPtr id, bool const_init = false);
|
||||
|
||||
ID* Id() const { return id.get(); }
|
||||
IDPtr IdPtr();
|
||||
const IDPtr& IdPtr() const;
|
||||
|
||||
ValPtr Eval(Frame* f) const override;
|
||||
void Assign(Frame* f, ValPtr v) override;
|
||||
|
|
|
@ -989,7 +989,7 @@ ExprPtr ModExpr::Duplicate()
|
|||
// nullptr, and the caller should have ensured that the starting point is
|
||||
// a disjunction (since a bare "/pat/ in var" by itself isn't a "cascade"
|
||||
// and doesn't present a potential optimization opportunity.
|
||||
static bool is_pattern_cascade(ExprPtr e, IDPtr& id,
|
||||
static bool is_pattern_cascade(const ExprPtr& e, IDPtr& id,
|
||||
std::vector<ConstExprPtr>& patterns)
|
||||
{
|
||||
auto lhs = e->GetOp1();
|
||||
|
@ -1002,7 +1002,7 @@ static bool is_pattern_cascade(ExprPtr e, IDPtr& id,
|
|||
rhs->Tag() != EXPR_NAME )
|
||||
return false;
|
||||
|
||||
auto rhs_id = rhs->AsNameExpr()->IdPtr();
|
||||
const auto& rhs_id = rhs->AsNameExpr()->IdPtr();
|
||||
|
||||
if ( id && rhs_id != id )
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue