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

Change initial size of get servers return map #230

Merged

Conversation

gabrielcorado
Copy link
Contributor

Closes #229

The initial size of the map used to return the servers (on ETCD service discovery) was using an incorrect reference. Even though this mistake didn't cause any issue, changing it makes it less confusing while reading the code.

@henriqueoelze henriqueoelze self-requested a review August 6, 2021 14:15
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1105367087

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage remained the same at 68.653%

Files with Coverage Reduction New Missed Lines %
agent/agent.go 2 83.96%
Totals Coverage Status
Change from base Build 1094680390: 0.0%
Covered Lines: 4619
Relevant Lines: 6728

💛 - Coveralls

Copy link
Contributor

@henriqueoelze henriqueoelze left a comment

Choose a reason for hiding this comment

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

LGTM, but do we have some unit test that we can change to validate it?

@gabrielcorado
Copy link
Contributor Author

Not really, since this isn't a bug fix, only a change on the code to make it more readable. We could have a map with an initial size less than necessary, but since it is the initial size, there is no problem with adding more elements. (here is a short example: https://play.golang.org/p/RxcuCNQ5lNG)

@gabrielcorado gabrielcorado merged commit 56a7cf9 into master Aug 6, 2021
@gabrielcorado gabrielcorado deleted the feature/change-initial-size-get-servers-return-map branch August 6, 2021 14:27
edisonwsk pushed a commit to edisonwsk/pitaya that referenced this pull request Aug 20, 2021
…initial-size-get-servers-return-map

Change initial size of get servers return map
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.

There's something wrong with this function: etcdServiceDiscovery.GetServersByType()
3 participants