Skip to content

Commit

Permalink
No need to track unmodified bytes separately now
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonpaulos committed Jun 22, 2023
1 parent 62af48d commit c9416f2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions daemon/algod/api/server/v2/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package v2

import (
"bytes"
"errors"
"math"
"sort"
Expand Down Expand Up @@ -145,7 +146,6 @@ func convertTKVToGenerated(tkv *basics.TealKeyValue) *model.TealKeyValueStore {
}

converted := make(model.TealKeyValueStore, 0, len(*tkv))
rawKeyBytes := make([]string, 0, len(*tkv))
for k, v := range *tkv {
converted = append(converted, model.TealKeyValue{
Key: []byte(k),
Expand All @@ -155,10 +155,9 @@ func convertTKVToGenerated(tkv *basics.TealKeyValue) *model.TealKeyValueStore {
Uint: v.Uint,
},
})
rawKeyBytes = append(rawKeyBytes, k)
}
sort.Slice(converted, func(i, j int) bool {
return rawKeyBytes[i] < rawKeyBytes[j]
return bytes.Compare(converted[i].Key, converted[j].Key) < 0
})
return &converted
}
Expand Down

0 comments on commit c9416f2

Please sign in to comment.