Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated Huffman Coding to Swift 3 syntax #344

Merged
merged 3 commits into from Jan 6, 2017

Conversation

pbodsk
Copy link
Contributor

@pbodsk pbodsk commented Jan 3, 2017

Hope I got this right 馃槃

@pbodsk pbodsk mentioned this pull request Jan 4, 2017
71 tasks
Copy link
Member

@kelvinlauKL kelvinlauKL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine other than a pair of overly verbose syntax. Thanks :)

@@ -3,21 +3,21 @@
import Foundation

let s1 = "so much words wow many compression"
if let originalData = s1.dataUsingEncoding(NSUTF8StringEncoding) {
print(originalData.length)
if let originalData = s1.data(using: String.Encoding.utf8) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per our style guidelines, you should shorten this to s1.data(using: .utf8).

print(decompressedData.length)

let s2 = String(data: decompressedData, encoding: NSUTF8StringEncoding)!
let s2 = String(data: decompressedData as Data, encoding: String.Encoding.utf8)!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: .utf8 rather than String.Encoding.utf8

@kelvinlauKL
Copy link
Member

Looks good, thanks @pbodsk!

@kelvinlauKL kelvinlauKL merged commit cc42dc1 into kodecocodes:master Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants