Skip to content

Commit

Permalink
Comment on Cost vs costFunc
Browse files Browse the repository at this point in the history
  • Loading branch information
jannotti committed Mar 26, 2022
1 parent 2aef60e commit 8256400
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions data/transactions/logic/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,10 @@ func (cx *EvalContext) step() error {

opcost := deets.Cost
if opcost == 0 {
// We use a constant (deets.Cost) to avoid the cost of an indirect
// function call in most cases. Consider getting the cost details into
// OpSpec so that a single (inlinable?) function can compute the cost,
// rather than a per opcode function pointer.
opcost = deets.costFunc(cx.program, cx.pc)
}
if opcost == 0 {
Expand Down

0 comments on commit 8256400

Please sign in to comment.