Skip to content

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 :)

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.

2 participants