Skip to content

Commit

Permalink
Remove vestiges of retain / release code
Browse files Browse the repository at this point in the history
  • Loading branch information
stig committed Nov 18, 2011
1 parent 22536a1 commit cb624fb
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions Classes/SBJsonTokeniser.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,33 +140,29 @@ - (sbjson_token_t)getStringToken:(NSObject**)token {
unichar ch;
{
NSMutableString *string = nil;
@try {
if (![_stream getRetainedStringFragment:&string])
return sbjson_token_eof;

if (!string) {
self.error = @"Broken Unicode encoding";
return sbjson_token_error;
}
if (![_stream getRetainedStringFragment:&string])
return sbjson_token_eof;

if (![_stream getUnichar:&ch]) {
return sbjson_token_eof;
}
if (!string) {
self.error = @"Broken Unicode encoding";
return sbjson_token_error;
}

if (acc) {
[acc appendString:string];

} else if (ch == '"') {
*token = [string copy];
[_stream skip];
return sbjson_token_string;

} else {
acc = [string mutableCopy];
}
if (![_stream getUnichar:&ch]) {
return sbjson_token_eof;
}
@finally {
string = nil;

if (acc) {
[acc appendString:string];

} else if (ch == '"') {
*token = [string copy];
[_stream skip];
return sbjson_token_string;

} else {
acc = [string mutableCopy];
}
}

Expand Down

0 comments on commit cb624fb

Please sign in to comment.