core/vm: expose intpool to stack dup method
Improve the duplication method of the stack to reuse big ints by passing in an existing integer pool.
This commit is contained in:
@@ -60,8 +60,8 @@ func (st *Stack) swap(n int) {
|
||||
st.data[st.len()-n], st.data[st.len()-1] = st.data[st.len()-1], st.data[st.len()-n]
|
||||
}
|
||||
|
||||
func (st *Stack) dup(n int) {
|
||||
st.push(new(big.Int).Set(st.data[st.len()-n]))
|
||||
func (st *Stack) dup(pool *intPool, n int) {
|
||||
st.push(pool.get().Set(st.data[st.len()-n]))
|
||||
}
|
||||
|
||||
func (st *Stack) peek() *big.Int {
|
||||
|
Reference in New Issue
Block a user