-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
go/mysql: use clear builtin for zerofill #16348
Conversation
This is implemented as the same performance optimization, but is a more clear intention. Signed-off-by: Matt Robenolt <matt@ydekproductions.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #16348 +/- ##
=======================================
Coverage 68.71% 68.71%
=======================================
Files 1547 1547
Lines 198287 198285 -2
=======================================
+ Hits 136243 136250 +7
+ Misses 62044 62035 -9 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// The clear built-in function clears maps and slices.
// For maps, clear deletes all entries, resulting in an empty map.
// For slices, clear sets all elements up to the length of the slice
// to the zero value of the respective element type. If the argument
// type is a type parameter, the type parameter's type set must
// contain only map or slice types, and clear performs the operation
// implied by the type argument.
func clear[T ~[]Type | ~map[Type]Type1](t T)
👍 Thanks, @mattrobenolt !
This is implemented as the same performance optimization, but is a more clear intention.
Related issues:
Part of #16789
Iteration from #16341
Checklist