-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Use "key" instead of "value" in HashMap exercise #2763
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
What motivates this change? The objective is to count values, so it seems like 'value' is a good name.
It uses a std::collections::HashMap to keep track of which values have been seen and how many times each one has appeared.
It is just that key/value have usually predefined meanings for hashmaps (associative containers in general). And as this is an exercise to for the API of hashmaps it might put some people off that the variable 'value' is used as a key. Unsure if the proposed renaming is the best though. What about "values -> itemOccurences" and "value -> item"? (Sorry about the formatting. I am on my phone atm.) |
I think a PR to change both the word used in the exercise and the variable name would be OK. |
I dont have a gmail account. |
The error log shows an obscured Gmail address. I don't know the details of
the cla process - is there no alternative?
…On Sun, Jun 29, 2025, 8:55 AM PaulXiCao ***@***.***> wrote:
*PaulXiCao* left a comment (google/comprehensive-rust#2763)
<#2763 (comment)>
Thanks for your pull request! It looks like this may be your first
contribution to a Google open source project. Before we can look at your
pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation
<https://github.com/google/comprehensive-rust/pull/2763/checks?check_run_id=43317406936>
of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of
the pull request.
I dont have a gmail account.
—
Reply to this email directly, view it on GitHub
<#2763 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAHAAKJNK4DB6WUOOC34VL3F7O5PAVCNFSM6AAAAAB6NJVZQSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMJWGY3TGMRRGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
From the FAQ:
|
No description provided.