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

balancer/wrr: prefer calling Equal() method of time.Time #7529

Merged
merged 4 commits into from
Aug 26, 2024

Conversation

aranjans
Copy link
Contributor

@aranjans aranjans commented Aug 18, 2024

Prefer calling Equal() method of time.Time over direct comparision.

RELEASE NOTES: none

@aranjans aranjans added the Type: Internal Cleanup Refactors, etc label Aug 18, 2024
@aranjans aranjans added this to the 1.67 Release milestone Aug 18, 2024
Copy link

codecov bot commented Aug 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.83%. Comparing base (b45fc41) to head (359462b).
Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7529      +/-   ##
==========================================
- Coverage   82.07%   81.83%   -0.25%     
==========================================
  Files         360      360              
  Lines       27533    27508      -25     
==========================================
- Hits        22599    22510      -89     
- Misses       3759     3799      +40     
- Partials     1175     1199      +24     
Files Coverage Δ
balancer/weightedroundrobin/balancer.go 80.51% <100.00%> (ø)

... and 29 files with indirect coverage changes

@aranjans aranjans requested review from zasweq and easwars August 18, 2024 09:48
@aranjans aranjans changed the title balancer/wrr: prefer calling Equal() method of time.Time over direct … balancer/wrr: prefer calling Equal() method of time.Time Aug 18, 2024
@aranjans aranjans requested review from dfawley and removed request for zasweq August 18, 2024 09:54
@aranjans aranjans assigned dfawley and unassigned zasweq Aug 18, 2024
Copy link
Contributor

@easwars easwars left a comment

Choose a reason for hiding this comment

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

There are a few more occurrences:

easwars@minetop: grpc-go$ grep -r "==.*time.Time{}" *
balancer/weightedroundrobin/balancer.go:	if w.nonEmptySince == (time.Time{}) {
balancer/weightedroundrobin/balancer.go:	if w.lastUpdated == (time.Time{}) {
balancer/weightedroundrobin/balancer.go:	if blackoutPeriod != 0 && (w.nonEmptySince == (time.Time{}) || now.Sub(w.nonEmptySince) < blackoutPeriod) {
test/config_selector_test.go:			if wantDeadline == (time.Time{}) {

balancer/weightedroundrobin/balancer.go Outdated Show resolved Hide resolved
@easwars easwars assigned aranjans and unassigned easwars and dfawley Aug 20, 2024
@aranjans aranjans assigned easwars and unassigned aranjans Aug 21, 2024
@easwars easwars assigned dfawley and unassigned easwars Aug 21, 2024
@purnesh42H purnesh42H self-requested a review August 26, 2024 09:15
@easwars easwars merged commit 9feed00 into grpc:master Aug 26, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants