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
Fix #2137: Two defects in j.n.PlainSocketImpl#read #2140
Fix #2137: Two defects in j.n.PlainSocketImpl#read #2140
Conversation
We correct two defects in the read method for java.net.PlainSocketImpl.
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.
I think this would look better if you just throw
from the if
and else
branches.
@ekrich Thank you for the review & suggestion. Both lead to the improvement of this submission. |
bytesNum match { | ||
case _ if (bytesNum > 0) => bytesNum | ||
|
||
case _ if (bytesNum == 0) => if (count == 0) 0 else -1 |
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.
case _ if (bytesNum == 0) => if (count == 0) 0 else -1 | |
case 0 => if (count == 0) 0 else -1 |
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.
…-native#2140) * Fix scala-native#2137: Two defects in j.n.PlainSocketImpl#read We correct two defects in the read method for java.net.PlainSocketImpl. * Incorporate review comment.
…-native#2140) * Fix scala-native#2137: Two defects in j.n.PlainSocketImpl#read We correct two defects in the read method for java.net.PlainSocketImpl. * Incorporate review comment.
We correct two defects in the read method for java.net.PlainSocketImpl.