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 #17338, broken showing of SimpleVector #17339

Merged
merged 1 commit into from
Jul 9, 2016
Merged

Conversation

JeffBezanson
Copy link
Member

No description provided.

@JeffBezanson JeffBezanson merged commit 00de421 into master Jul 9, 2016
@tkelman tkelman deleted the jb/fix17338 branch July 9, 2016 02:24
@@ -173,6 +173,7 @@ done(v::SimpleVector,i) = (i > v.length)
isempty(v::SimpleVector) = (v.length == 0)
indices(v::SimpleVector) = (OneTo(length(v)),)
linearindices(v::SimpleVector) = indices(v, 1)
indices(v::SimpleVector, d) = d <= 1 ? indices(v)[d] : OneTo(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't the default fallback definition for indices ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but SimpleVector is not an AbstractArray. It might be possible to make it so, but that would be a more complicated change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the fallback need to be only for AbstractArray or does it make sense for Any?

Copy link
Member

@timholy timholy Jul 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to make it the default fallback. EDIT: nvm, ndims isn't defined for SimpleVector and in any case isn't inferrable, so that would lead to performance regressions in some cases.

mfasi pushed a commit to mfasi/julia that referenced this pull request Sep 5, 2016
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