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

return keys for function States #4311

Merged
merged 5 commits into from
Jun 25, 2024
Merged

return keys for function States #4311

merged 5 commits into from
Jun 25, 2024

Conversation

CoderZhi
Copy link
Collaborator

return keys, which may be useful if input keys = nil

Fixes #(issue)

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Code refactor or improvement
  • [] Breaking change (fix or feature that would cause a new or changed behavior of existing functionality)
  • [] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [] make test
  • [] fullsync
  • [] Other test (please specify)

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • [] My code follows the style guidelines of this project
  • [] I have performed a self-review of my code
  • [] I have commented my code, particularly in hard-to-understand areas
  • [] I have made corresponding changes to the documentation
  • [] My changes generate no new warnings
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] New and existing unit tests pass locally with my changes
  • [] Any dependent changes have been merged and published in downstream modules

@CoderZhi CoderZhi requested review from dustinxie, Liuhaai, envestcc and a team as code owners June 24, 2024 21:38
return &iterator{index: 0, states: states}
func NewIterator(keys [][]byte, states [][]byte) (Iterator, error) {
if len(keys) != len(states) {
fmt.Println(string(debug.Stack()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use errors.Wrap to wrap func call stack into err

values = append(values, value)
}
} else {
ks = make([][]byte, 0, len(keys))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need, already defined at L187

Copy link

sonarcloud bot commented Jun 25, 2024

@CoderZhi CoderZhi merged commit b558929 into master Jun 25, 2024
3 checks passed
@CoderZhi CoderZhi deleted the return_states_with_key branch June 25, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants