Skip to content

Commit

Permalink
minor code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
deepanshutr committed Jul 31, 2023
1 parent 241255f commit edb19ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (

func GetTotalSupply(collection helpers.Collection, ownableID ids.OwnableID) sdkTypes.Int {
value := sdkTypes.ZeroInt()
accumulator := func(record helpers.Record) bool {

collection.Iterate(key.NewKey(baseIDs.NewSplitID(ownableID, baseIDs.PrototypeIdentityID())), func(record helpers.Record) bool {
value = value.Add(mappable.GetSplit(record.GetMappable()).GetValue())
return false
}
collection.Iterate(key.NewKey(baseIDs.NewSplitID(ownableID, baseIDs.PrototypeIdentityID())), accumulator)
})

return value
}
File renamed without changes.

0 comments on commit edb19ed

Please sign in to comment.