Fix Vector#slice for arguments near Int.max/minValue#10331
Fix Vector#slice for arguments near Int.max/minValue#10331som-snytt merged 1 commit intoscala:2.13.xfrom
Vector#slice for arguments near Int.max/minValue#10331Conversation
|
|
||
| @Test | ||
| def testWierdAlignments1(): Unit = { | ||
| def testWeirdAlignments1(): Unit = { |
There was a problem hiding this comment.
shoutout to Weird Al!
SethTisue
left a comment
There was a problem hiding this comment.
I'm tentatively hitting “Approve”, but I would appreciate at least one more pair of eyes from @scala/collections crew
|
perhaps @AminMal would like to take a look |
Thanks, I'd love to. I took a look and it seems like it actually should've been this way in the first place, and couldn't find a scenario where this change could go wrong. Besides from the actual bug (which would be fixed in this PR), it makes sense to check if the new length is not negative, prior to comparing lengths and creating a slice out of the current vector. |
I understand the "besides" clause, but not the part that "makes sense". Rebased. |
b9dc377 to
eaac91e
Compare
I mean it makes sense to check that |
|
You're saying the current fix makes sense, not that "in addition, it would make sense to do an additional check"... English verb tenses and moods are so confusing. |
I get it, I'm not a "native English speaker", so that's why, sorry if it made you confused. All I was saying was that the change in the PR makes sense :) |
|
thank you both! |
Vector#slice for arguments near Int.max/minValue
|
@AminMal thanks again for review. I was just reading wrong what you wrote right. Possibly I was in a panic that it would turn into a marathon Ichoran-like thread about arithmetic. |
…r-slice Improve check for empty vector slice
…r-slice Improve check for empty vector slice
Fixes scala/bug#12739
@scala/collections
At first I'm like, even I can understand this one, it's not like those Rex Kerr issues. Unless I don't understand it.