Skip to content
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 offset when widening collections #35298

Merged
merged 2 commits into from
Mar 30, 2020
Merged

Fix offset when widening collections #35298

merged 2 commits into from
Mar 30, 2020

Conversation

timholy
Copy link
Member

@timholy timholy commented Mar 29, 2020

The final argument of copyto! is a count; subtracting 1 from the current index works only if indexing starts at 1. This also explicitly uses LinearIndices just as occurs in upstream callers.

@timholy
Copy link
Member Author

timholy commented Mar 29, 2020

It should be noted that the destination array typically supports linear indexing, and so none of our current tests check this code for IndexCartesian destination types. Consequently, I decided to move the TSlow type from test/abstractarray.jl to test/testhelpers/ so that it can be reused. It also seemed to be an opportune moment to update it given the merging of #11242. A trip down memory lane with @mbauman 😄.

@JeffBezanson JeffBezanson merged commit fa071ff into master Mar 30, 2020
@JeffBezanson JeffBezanson deleted the teh/collectto branch March 30, 2020 18:02
@KristofferC KristofferC mentioned this pull request Apr 4, 2020
27 tasks
@KristofferC KristofferC mentioned this pull request Apr 15, 2020
56 tasks
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.

3 participants