We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Base.show
1 parent 26e4f8c commit 85f3a33Copy full SHA for 85f3a33
src/utils.jl
@@ -94,12 +94,10 @@ Base.oneunit(::Type{<:AbstractDimensions}) = error("There is no such thing as a
94
95
Base.show(io::IO, d::AbstractDimensions) =
96
let tmp_io = IOBuffer()
97
- for k in keys(d)
98
- if !iszero(d[k])
99
- print(tmp_io, dimension_name(d, k))
100
- isone(d[k]) || pretty_print_exponent(tmp_io, d[k])
101
- print(tmp_io, " ")
102
- end
+ for k in filter(k -> !iszero(d[k]), keys(d))
+ print(tmp_io, dimension_name(d, k))
+ isone(d[k]) || pretty_print_exponent(tmp_io, d[k])
+ print(tmp_io, " ")
103
end
104
s = String(take!(tmp_io))
105
s = replace(s, r"^\s*" => "")
0 commit comments