We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0055795 commit 58058cfCopy full SHA for 58058cf
Huffman Coding/Huffman.playground/Contents.swift
@@ -3,7 +3,7 @@
3
import Foundation
4
5
let s1 = "so much words wow many compression"
6
-if let originalData = s1.data(using: String.Encoding.utf8) {
+if let originalData = s1.data(using: .utf8) {
7
print(originalData.count)
8
9
let huffman1 = Huffman()
@@ -17,7 +17,7 @@ if let originalData = s1.data(using: String.Encoding.utf8) {
17
let decompressedData = huffman2.decompressData(data: compressedData, frequencyTable: frequencyTable)
18
print(decompressedData.length)
19
20
- let s2 = String(data: decompressedData as Data, encoding: String.Encoding.utf8)!
+ let s2 = String(data: decompressedData as Data, encoding: .utf8)!
21
print(s2)
22
assert(s1 == s2)
23
}
0 commit comments