-
Notifications
You must be signed in to change notification settings - Fork 169
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
#308: Equality #309
#308: Equality #309
Conversation
Codecov Report
@@ Coverage Diff @@
## master #309 +/- ##
============================================
+ Coverage 77.76% 77.84% +0.08%
- Complexity 431 437 +6
============================================
Files 137 138 +1
Lines 1385 1404 +19
Branches 68 72 +4
============================================
+ Hits 1077 1093 +16
- Misses 288 291 +3
Partials 20 20
Continue to review full report at Codecov.
|
break; | ||
} | ||
} | ||
return (int) Math.signum(result); |
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.
@fabriciofx please, check the article on the blog, the code is changed there. Pay attention to this thread of comments: http://www.yegor256.com/2017/07/11/how-to-redesign-equals.html#comment-3420679770
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.
@yegor256 Right. I made some changes. Could you check them?
* @since 0.12 | ||
* @checkstyle JavadocMethodCheck (500 lines) | ||
*/ | ||
public final class EqualityTest { |
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.
@fabriciofx you may be interested in more tests, as we did in this thread: http://www.yegor256.com/2017/07/11/how-to-redesign-equals.html#comment-3420679770
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.
@yegor256 Right. I made some changes. Could you check them?
@fabriciofx thanks for the code, looks good, but please pay attention to my comments above |
@0crat in |
@llorllale Job #309 is now in scope, role is |
This pull request #309 is assigned to @neonailol/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @llorllale/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer |
@neonailol/z this job was assigned to you 5days ago. It will be taken away from you soon, unless you close it, see §8. Read this and this, please. |
@0crat resign @neonailol |
@llorllale The user @neonailol/z resigned from #309, please stop working. Reason for job resignation: Order was cancelled |
This pull request #309 is assigned to @SharplEr/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @llorllale/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer |
int result = 0; | ||
for (int idx = max; idx > 0; --idx) { | ||
byte first = 0; | ||
if (idx <= left.length) { |
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.
@fabriciofx Looks like code can be more optimal. You can remove if
statements from the loop. Get a longer array and check its last bytes is zero. After that, you can compare a shorter array with remaining part of the longer one with only one if
statement.
* @checkstyle JavadocMethodCheck (500 lines) | ||
*/ | ||
@SuppressWarnings("PMD.AvoidDuplicateLiterals") | ||
public final class EqualityTest { |
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.
@fabriciofx You have lost one behavior. When one array longer than another, but have zeros on the tail. Like {1, 1, 0, 0}
and {1,1}
. As I understand it is an important part of API.
@fabriciofx Please pay attention to my remarks. |
@fabriciofx ping) |
@llorllale @SharplEr Fabricio is inactive. This job is assigned to me and I've created new PR #809 |
This pull request #309 is assigned to @proshin-roman/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @llorllale/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer |
@llorllale This pull request must be closed as there is another one #809 that is reviewed and waiting for merging. |
@proshin-roman thanks |
@elenavolokhova/z please review this job completed by @proshin-roman/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed |
The job #309 is now out of scope |
Payment to |
@0crat quality acceptable |
Order was finished, quality is "acceptable": +15 point(s) just awarded to @proshin-roman/z |
Quality review completed: +8 point(s) just awarded to @elenavolokhova/z |
As per #308.