diff options
| author | Mark Rowe <mark@vector35.com> | 2025-12-10 15:20:25 -0800 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2025-12-15 20:25:23 -0800 |
| commit | 95b849d05d05ae9e55eb839508536d5af314d331 (patch) | |
| tree | f06fc6ea5c13cc4972fe8b9fdd5c30d94779b045 /mediumlevelilinstruction.cpp | |
| parent | 2f1150703636b2b06d84bb66853fce7382bf6f29 (diff) | |
Use bn::base::function_ref instead of std::function for parameters that are not stored
This avoids the overhead of constructing a `std::function`, which may
require a heap allocation, when calling functions that immediately
invokes a function object.
Diffstat (limited to 'mediumlevelilinstruction.cpp')
| -rw-r--r-- | mediumlevelilinstruction.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mediumlevelilinstruction.cpp b/mediumlevelilinstruction.cpp index b1b9d7d6..00189313 100644 --- a/mediumlevelilinstruction.cpp +++ b/mediumlevelilinstruction.cpp @@ -1350,7 +1350,7 @@ void MediumLevelILInstructionBase::ClearAttribute(BNILInstructionAttribute attri } -void MediumLevelILInstruction::VisitExprs(const std::function<bool(const MediumLevelILInstruction& expr)>& func) const +void MediumLevelILInstruction::VisitExprs(bn::base::function_ref<bool(const MediumLevelILInstruction& expr)> func) const { if (!func(*this)) return; @@ -1569,7 +1569,7 @@ ExprId MediumLevelILInstruction::CopyTo(MediumLevelILFunction* dest, const ILSou ExprId MediumLevelILInstruction::CopyTo(MediumLevelILFunction* dest, - const std::function<ExprId(const MediumLevelILInstruction& subExpr)>& subExprHandler, + bn::base::function_ref<ExprId(const MediumLevelILInstruction& subExpr)> subExprHandler, const ILSourceLocation& sourceLocation) const { vector<ExprId> params; |
