Skip to content

Commit 21757de

Browse files
committed
simplify Base.convert => convert
1 parent 360d09b commit 21757de

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

test/FixedDecimal.jl

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -338,36 +338,36 @@ const UWFD2 = FixedDecimal{UInt128, 2}
338338

339339
@testset "128-bit conversion performance" begin
340340
# Baseline cases
341-
@test @allocated(Base.convert(FD2, Int8(-1))) == 0
342-
@test @allocated(Base.convert(FD2, UInt8(1))) == 0
343-
@test @allocated(Base.convert(SFD2, Int8(-1))) == 0
341+
@test @allocated(convert(FD2, Int8(-1))) == 0
342+
@test @allocated(convert(FD2, UInt8(1))) == 0
343+
@test @allocated(convert(SFD2, Int8(-1))) == 0
344344

345345
# Int 128 cases
346-
@test @allocated(Base.convert(WFD2, 1)) == 0
347-
@test @allocated(Base.convert(WFD2, 1)) == 0
348-
@test @allocated(Base.convert(UWFD2, 1)) == 0
349-
@test @allocated(Base.convert(WFD2, -1)) == 0
350-
# @test @allocated(Base.convert(UWFD2, -1)) == 32 # not sure how best to test this
351-
@test @allocated(Base.convert(WFD2, UInt(1))) == 0
352-
@test @allocated(Base.convert(UWFD2, UInt(1))) == 0
353-
354-
@test @allocated(Base.convert(WFD2, Int128(1))) == 0
355-
@test @allocated(Base.convert(UWFD2, Int128(1))) == 0
356-
@test @allocated(Base.convert(WFD2, UInt128(1))) == 0
357-
@test @allocated(Base.convert(UWFD2, UInt128(1))) == 0
358-
@test @allocated(Base.convert(WFD2, Int128(-1))) == 0
359-
360-
@test @allocated(Base.convert(FD2, Int128(1))) == 0
361-
@test @allocated(Base.convert(UFD2, Int128(1))) == 0
362-
@test @allocated(Base.convert(FD2, UInt128(1))) == 0
363-
@test @allocated(Base.convert(UFD2, UInt128(1))) == 0
364-
@test @allocated(Base.convert(FD2, Int128(-1))) == 0
346+
@test @allocated(convert(WFD2, 1)) == 0
347+
@test @allocated(convert(WFD2, 1)) == 0
348+
@test @allocated(convert(UWFD2, 1)) == 0
349+
@test @allocated(convert(WFD2, -1)) == 0
350+
# @test @allocated(convert(UWFD2, -1)) == 32 # not sure how best to test this
351+
@test @allocated(convert(WFD2, UInt(1))) == 0
352+
@test @allocated(convert(UWFD2, UInt(1))) == 0
353+
354+
@test @allocated(convert(WFD2, Int128(1))) == 0
355+
@test @allocated(convert(UWFD2, Int128(1))) == 0
356+
@test @allocated(convert(WFD2, UInt128(1))) == 0
357+
@test @allocated(convert(UWFD2, UInt128(1))) == 0
358+
@test @allocated(convert(WFD2, Int128(-1))) == 0
359+
360+
@test @allocated(convert(FD2, Int128(1))) == 0
361+
@test @allocated(convert(UFD2, Int128(1))) == 0
362+
@test @allocated(convert(FD2, UInt128(1))) == 0
363+
@test @allocated(convert(UFD2, UInt128(1))) == 0
364+
@test @allocated(convert(FD2, Int128(-1))) == 0
365365
end
366366

367367
@testset "BigInt conversion performance" begin
368368
b = BigInt(2)
369369
# Special-cased f=1 to not allocate for BigInt => FD conversion
370-
@test @allocated(Base.convert(FixedDecimal{BigInt, 1}, b)) == 0
370+
@test @allocated(convert(FixedDecimal{BigInt, 1}, b)) == 0
371371
end
372372

373373
end # module PerfTests

0 commit comments

Comments
 (0)