-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Simplify some code #3580
Simplify some code #3580
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
1 similar comment
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
-1 on the LocalCache changes, just as commented in PR #3492 this fixes what is presumably reported by an IDE at the expense of readability for no real reason. |
@ljacqu oh,sorry. I prefer the version that I commit because I would do the same thing in my daily coding.I can also understand that different projects have different coding styles. Do you mean that all the changes of 'if' statement is unnecessary? If you think so, I would revert them into the master version! |
…dability of the code.
@ljacqu I think that 'sum == 0' needs to be preserved because 'sum == 0' itself has the meaning of isEmpty. Positive thinking is more conducive to people's understanding than negative thinking.If you do not agree with that. I can also revert other 'if' statement to the master version. |
Sorry if there was any misunderstanding, I‘m not in any way affiliated/involved with Guava – I just posted a comment as an individual passing by :) |
@ljacqu That’s all right.I am very glad that you can reply to this pr.Thanks for your suggestion |
Fixes #3580 RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=272440567
Fixes #3580 RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=272440567
Remove some redundant 'if' statement.Besides, I use .toArray(new MyClass[0]) replace .toArray(new MyClass[myList.size()]) for improving the efficiency of the code.
https://stackoverflow.com/questions/174093/toarraynew-myclass0-or-toarraynew-myclassmylist-size