Skip to content

Commit 3864f62

Browse files
committed
Reduce allocations
1 parent 85f3a33 commit 3864f62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ end
114114

115115
string_rational(x) = isinteger(x) ? string(round(Int, x)) : string(x)
116116
pretty_print_exponent(io::IO, x) = print(io, to_superscript(string_rational(x)))
117-
const SUPERSCRIPT_MAPPING = ['', '¹', '²', '³', '', '', '', '', '', '']
118-
const INTCHARS = ['0' + i for i = 0:9]
117+
const SUPERSCRIPT_MAPPING = ('', '¹', '²', '³', '', '', '', '', '', '')
118+
const INTCHARS = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
119119
to_superscript(s::AbstractString) = join(
120120
map(replace(replace(s, "-" => ""), r"//" => "")) do c
121121
c INTCHARS ? SUPERSCRIPT_MAPPING[parse(Int, c)+1] : c

0 commit comments

Comments
 (0)