bradyrussell / UISCoin

Java cryptocurrency made to learn more about Bitcoin.
https://bradyrussell.github.io/UISCoin/javadoc
0 stars 1 forks source link

optimization: down cast integers #53

Open bradyrussell opened 3 years ago

bradyrussell commented 3 years ago

if an integer is pushed that could fit into a smaller integer type (64 - > 32 -> 8) prefer to push the smallest type then convert

push 6 (int32) 010400000006

optimized to 0101062A (push 0x06 convert8to32)

push 6 (int64) 01080000000000000006

optimized to 0101062A2D (push 0x06 convert8to32 convert32to64)