Skip to content

Commit e975580

Browse files
committed
Remove bitwidth Tuple method
1 parent f4b1a1b commit e975580

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/NarrowTuple.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,6 @@ function field_bitwidths(::Type{Ts}) where Ts<:Tuple
136136
return map(T -> Int(bitwidth(T)), fieldtypes(Ts))
137137
end
138138

139-
function bitwidth(::Type{Ts}) where Ts<:Tuple
140-
return sum(field_bitwidths(Ts); init=0)
141-
end
142-
143139
function exact_unsigned_type(total_bits::Int)
144140
total_bits == 8 ? UInt8 :
145141
total_bits == 16 ? UInt16 :
@@ -155,7 +151,7 @@ function narrow_storage_type(total_bits::Int)
155151
end
156152

157153
function narrow_storage_type(::Type{Ts}) where Ts<:Tuple
158-
return narrow_storage_type(bitwidth(Ts))
154+
return narrow_storage_type(sum(field_bitwidths(Ts); init=0))
159155
end
160156

161157
function narrow_mask(::Type{U}, width::Int) where U<:Unsigned

0 commit comments

Comments
 (0)