continue can be replaced with break#553
continue can be replaced with break#553xiaoed wants to merge 1 commit intoapache:masterfrom xiaoed:master
Conversation
|
Thanks @a470577391 , looks good, I think you're right, but please create a jira for this PR on https://issues.apache.org/jira/projects/ZOOKEEPER/ |
| continue; | ||
| break; | ||
| } | ||
| // the files |
There was a problem hiding this comment.
@a470577391 Yes,since the files is already order by zxid asc.
I have two suggestions personally if you want to open a new JIRA:
1: rename the method to a explicit one, getLogFiles is ambiguous
2. use Java8 lambda to rewrite the method elegantly,stream, filter, max will be useful.
There was a problem hiding this comment.
Thank you for your suggestion.
- i'm going to try.
- i think use Java8 may be unfriendly to the lower version.
There was a problem hiding this comment.
- ZooKeeper runs in Java, release 1.8 or greater 😄
There was a problem hiding this comment.
@a470577391 ZooKeeper 3.4.x runs on Java7, version 3.5.x and 3.6.x are not stable yet, they use Java8.
|
IMHO: |
|
@a470577391 Thanks for the contribution. |
FileTxnLog.getLogFiles()
continue can be replaced with break