Skip to content

Commit

Permalink
Make print_matrix O(1) again (#23681)
Browse files Browse the repository at this point in the history
(cherry picked from commit c23d6bc)
  • Loading branch information
iamed2 authored and ararslan committed Oct 6, 2017
1 parent 1a1ef7a commit f651277
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1463,9 +1463,8 @@ function print_matrix(io::IO, X::AbstractVecOrMat,
postsp = ""
@assert strwidth(hdots) == strwidth(ddots)
sepsize = length(sep)
inds1, inds2 = indices(X,1), indices(X,2)
m, n = length(inds1), length(inds2)
rowsA, colsA = collect(inds1), collect(inds2)
rowsA, colsA = indices(X,1), indices(X,2)
m, n = length(rowsA), length(colsA)
# To figure out alignments, only need to look at as many rows as could
# fit down screen. If screen has at least as many rows as A, look at A.
# If not, then we only need to look at the first and last chunks of A,
Expand Down

0 comments on commit f651277

Please sign in to comment.