ainame / AMEURLSession

AMEURLSession provide the simple and customizable interface of NSURLSession family classes to easy using.
MIT License
6 stars 1 forks source link

AMEURLResponseHTTPResponseSerializer ignores NSURLResponse's textEncodingName #2

Open ypresto opened 10 years ago

ypresto commented 10 years ago

Xcode's static analyzer detected dead store in following code:

    NSStringEncoding stringEncoding = self.stringEncoding;
    if (response.textEncodingName) {
        CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName);
        if (encoding != kCFStringEncodingInvalidId) {
            stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding);
        }
    }

local var stringEncoding is not used in any of following lines.

https://github.com/ainame/AMEURLSession/blob/92f4f757e209ec9908eba85dac14fadfc632a4c9/AMEURLSession/Classes/AMEURLResponseSerialization.m#L33

https://github.com/ainame/AMEURLSession/blob/92f4f757e209ec9908eba85dac14fadfc632a4c9/AMEURLSession/Classes/AMEURLResponseSerialization.m#L37

ainame commented 10 years ago

oh...