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

assert: simplify isNil implementation #1506

Merged
merged 1 commit into from Jan 21, 2024
Merged

Conversation

dolmen
Copy link
Collaborator

@dolmen dolmen commented Nov 9, 2023

Summary

Simpler and faster (also less allocations) in internal function isNil.

Changes

  • Simplify isNil: use a switch on reflect.Value.Kind() instead of browsing a slice of allowed Kinds.

Motivation

Less code, less complexity, less memory usage, more speed.

Simpler and faster (also less allocations) in internal isNil().
@dolmen dolmen self-assigned this Nov 9, 2023
assert/assertions.go Show resolved Hide resolved
@dolmen
Copy link
Collaborator Author

dolmen commented Jan 19, 2024

@MovieStoreGuy Could you review this?

@MovieStoreGuy MovieStoreGuy merged commit 92533fa into master Jan 21, 2024
14 checks passed
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.

None yet

3 participants