Skip to content
Commit d0d9e09c authored by LaughingMan's avatar LaughingMan Committed by Dzmitry Malyshau
Browse files

[spv-in] Copy less bytes in `parse_function`

The initial intention was to make the code a little more elegant and match on
the Vec itself instead of its length, however there's also a - probably
minuscule - performance advantage:

`Vec::remove` internally copies the removed element onto the stack. In this case
that's a `StructMember` weighting 48 bytes. The `Binding` we are actually
interested in is only 8 bytes tough.

Cloning just the `Binding` saves us from copying 40 bytes for nothing.
parent 6166b95b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment