You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You already have an entry for this in the errata, but I don't think that is correct. The branch you marked as not being able to be reached can be reached if there are multiple null names, see example below:
I think the below branch can never be reached though:
The above can be replaced by:
The text was updated successfully, but these errors were encountered:
I've moved the big comment and added a couple of new comments to clarify the code. The final else still needs to return 0 though to indicate that when both objects are null, they are equal.
That final else will never be reached though the way you have it set up. If other is not null it goes into the first if. Then you have an 'else if (other is null)', but we already know it is null since it didn't go into the 1st if, and it will always go into the 2nd and never reach the final else. So, you can just make the 2nd an else instead and set position to -1 there.
You already have an entry for this in the errata, but I don't think that is correct. The branch you marked as not being able to be reached can be reached if there are multiple null names, see example below:
I think the below branch can never be reached though:
The above can be replaced by:
The text was updated successfully, but these errors were encountered: