Skip to content

SI-9936 SeqLike.indexWhere starts at zero#5421

Merged
lrytz merged 1 commit intoscala:2.12.xfrom
som-snytt:issue/9936
Sep 30, 2016
Merged

SI-9936 SeqLike.indexWhere starts at zero#5421
lrytz merged 1 commit intoscala:2.12.xfrom
som-snytt:issue/9936

Conversation

@som-snytt
Copy link
Contributor

This follows the Scaladoc, and makes

"abcdef".indexOf('c', -1)

work like

"abcdef".toVector.indexOf('c', -1)

This follows the Scaladoc, and makes
```
"abcdef".indexOf('c', -1)
```
work like
```
"abcdef".toVector.indexOf('c', -1)
```
@scala-jenkins scala-jenkins added this to the 2.12.1 milestone Sep 26, 2016
@lrytz
Copy link
Member

lrytz commented Sep 30, 2016

LGTM, thanks!

@lrytz lrytz merged commit e1e895c into scala:2.12.x Sep 30, 2016
@som-snytt som-snytt deleted the issue/9936 branch October 7, 2016 06:17
@tzachz
Copy link

tzachz commented Dec 30, 2016

Should there be a similar fix for what seems to be the same issue in LineraSeqOptimized? See here.

scala> "abcde".indexOf('c', -1)
res3: Int = 2

scala> "abcde".toVector.indexOf('c', -1)
res4: Int = 2

scala> "abcde".toList.indexOf('c', -1)
res5: Int = 1

@som-snytt
Copy link
Contributor Author

@tzachz Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants