Commit d87debb
Add "copy-constructor" to prevent (incorrect) convert call when type is the same (#36)
Before this change:
```
julia> x = f = FixedDecimal{Int128,2}(3.25)
>> FixedDecimal{Int128,2}(3.25)
julia> @Btime x = FixedDecimal{Int128, 2}($f)
7.272 μs (159 allocations: 2.73 KiB)
>> FixedDecimal{Int128,2}(3.25)
```
After this change:
```
julia> x = f = FixedDecimal{Int128,2}(3.25)
>> FixedDecimal{Int128,2}(3.25)
julia> @Btime x = FixedDecimal{Int128, 2}($f)
1.508 ns (0 allocations: 0 bytes)
>> FixedDecimal{Int128,2}(3.25)
```1 parent cc6aed3 commit d87debb
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| |||
0 commit comments