From 95b849d05d05ae9e55eb839508536d5af314d331 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Wed, 10 Dec 2025 15:20:25 -0800 Subject: 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. --- lowlevelilinstruction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lowlevelilinstruction.cpp') diff --git a/lowlevelilinstruction.cpp b/lowlevelilinstruction.cpp index 036ef093..975720c1 100644 --- a/lowlevelilinstruction.cpp +++ b/lowlevelilinstruction.cpp @@ -1885,7 +1885,7 @@ void LowLevelILInstructionBase::ClearAttribute(BNILInstructionAttribute attribut } -void LowLevelILInstruction::VisitExprs(const std::function& func) const +void LowLevelILInstruction::VisitExprs(bn::base::function_ref func) const { if (!func(*this)) return; @@ -2096,7 +2096,7 @@ ExprId LowLevelILInstruction::CopyTo(LowLevelILFunction* dest, const ILSourceLoc ExprId LowLevelILInstruction::CopyTo( - LowLevelILFunction* dest, const std::function& subExprHandler, const ILSourceLocation& sourceLocation) const + LowLevelILFunction* dest, bn::base::function_ref subExprHandler, const ILSourceLocation& sourceLocation) const { vector params; BNLowLevelILLabel* labelA; -- cgit v1.3.1