Skip to content

Commit 6f1a81c

Browse files
committed
Removed assertion
1 parent 945d9cf commit 6f1a81c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Sources/Encoder.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ internal extension TLVEncoder.Encoder {
184184

185185
func boxEncodable <T: Encodable> (_ value: T) throws -> Data {
186186

187-
// should not call this function
188-
assert(value as? TLVRawEncodable == nil, "Should not call this method for native types")
189-
190187
if let data = value as? Data {
191188
return data
192189
} else if let uuid = value as? UUID {
@@ -502,9 +499,9 @@ internal final class TLVSingleValueEncodingContainer: SingleValueEncodingContain
502499

503500
func encode(_ value: String) throws { write(encoder.box(value)) }
504501

505-
func encode(_ value: Double) throws { write(encoder.boxNumeric(value.bitPattern)) }
502+
func encode(_ value: Double) throws { write(encoder.boxDouble(value)) }
506503

507-
func encode(_ value: Float) throws { write(encoder.boxNumeric(value.bitPattern)) }
504+
func encode(_ value: Float) throws { write(encoder.boxFloat(value)) }
508505

509506
func encode(_ value: Int) throws { write(encoder.boxNumeric(Int32(value))) }
510507

0 commit comments

Comments
 (0)