Skip to content

Commit

Permalink
Use range syntax for description of squeeze requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
simonster committed Dec 9, 2014
1 parent 2f09b93 commit a296b44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ _sub(t::Tuple, s::Tuple) = _sub(tail(t), tail(s))

function squeeze(A::AbstractArray, dims::Dims)
for i in 1:length(dims)
1 <= dims[i] <= ndims(A) || error("squeezed dims must be in range [1, ndims(A)]")
1 <= dims[i] <= ndims(A) || error("squeezed dims must be in range 1:ndims(A)")
size(A, dims[i]) == 1 || error("squeezed dims must all be size 1")
for j = 1:i-1
dims[j] == dims[i] && error("squeezed dims must be unique")
Expand Down
2 changes: 1 addition & 1 deletion doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4484,7 +4484,7 @@ Indexing, Assignment, and Concatenation
.. function:: squeeze(A, dims)

Remove the dimensions specified by ``dims`` from array ``A``. Elements of
``dims`` must be unique and be within the interval ``[1, ndims(A)]``.
``dims`` must be unique and within the range ``1:ndims(A)``.

.. function:: vec(Array) -> Vector

Expand Down

0 comments on commit a296b44

Please sign in to comment.