Skip to content

token api: reduce the number of allocated structs #1159

@adecaro

Description

@adecaro

For example, every time we retrieve the public parameters using the Token API, we execute the following code:

func (c *PublicParametersManager) PublicParameters() *PublicParameters {
	pp := c.ppm.PublicParameters()
	if pp == nil {
		return nil
	}
	return &PublicParameters{PublicParameters: pp, ppm: c.ppm}
}

that instantiates a new struct. This struct can be instantiated once at the beginning and reused over and over again.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions