Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce maximum_size() to implement size_hint for set of values #93

Open
gui1117 opened this issue Jun 3, 2019 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@gui1117
Copy link
Contributor

gui1117 commented Jun 3, 2019

When implementing size_hint for a vector or a set we don't want to iterate on all the values to actually get a hint.
One way to do so would be to have two method one taking a value size_hint(&self) and another one taking no value maxium_size().

thus they would be used as such:

  • maximum_size() used on set of values
  • size_hint(&self) used on individual values,

size_hint(&self) (thought maybe renamed) would default implementation to maximum_size()

@gui1117 gui1117 added the enhancement New feature or request label Jun 3, 2019
@bkchr bkchr added this to the parity-scale-codec-v1 milestone Jun 25, 2019
@bkchr bkchr removed this from the parity-scale-codec-v1 milestone Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants