decred / dcrd

Decred daemon in Go (golang).
https://decred.org
ISC License
731 stars 288 forks source link

mixpool: Define vars for errs without formatting #3346

Closed jrick closed 3 months ago

jrick commented 3 months ago

This avoids reallocating new error variables each time the error is returned.

jrick commented 3 months ago

This is misleading, all of the ones returned as ruleErrors will still allocate.

The main motive for this is to avoid allocating on not looking up a message. Closing and will focus on just that instead.

davecgh commented 3 months ago

I realize that it wouldn't stop allocs because error interfaces always alloc, but I still thought it was a nice change to consolidate the errors.