Loading...
cache-builder/JSONReader.mm dyld-1235.2 dyld-955
--- dyld/dyld-1235.2/cache-builder/JSONReader.mm
+++ dyld/dyld-955/cache-builder/JSONReader.mm
@@ -206,47 +206,36 @@
 }
 
 Node readJSON(Diagnostics& diags, const char* filePath) {
-    Node resultNode;
-
-    @autoreleasepool {
-        NSInputStream* inputStream = [NSInputStream inputStreamWithFileAtPath:[NSString stringWithUTF8String:filePath]];
-        if (!inputStream) {
-            diags.error("Could not option json file: '%s'\n", filePath);
-            return Node();
-        }
-        [inputStream open];
-
-        NSError* error = nil;
-        id jsonObject = [NSJSONSerialization JSONObjectWithStream:inputStream options:NSJSONReadingMutableContainers error:&error];
-        if (!jsonObject) {
-            diags.error("Could not deserialize json file: '%s' because '%s'\n", filePath, [[error debugDescription] UTF8String]);
-            [inputStream close];
-            return Node();
-        }
-
-        resultNode = parseNode(diags, jsonObject);
+    NSInputStream* inputStream = [NSInputStream inputStreamWithFileAtPath:[NSString stringWithUTF8String:filePath]];
+    if (!inputStream) {
+        diags.error("Could not option json file: '%s'\n", filePath);
+        return Node();
+    }
+    [inputStream open];
+
+    NSError* error = nil;
+    id jsonObject = [NSJSONSerialization JSONObjectWithStream:inputStream options:NSJSONReadingMutableContainers error:&error];
+    if (!jsonObject) {
+        diags.error("Could not deserializer json file: '%s' because '%s'\n", filePath, [[error localizedFailureReason] UTF8String]);
         [inputStream close];
-    }
-
-    return resultNode;
+        return Node();
+    }
+
+    Node node = parseNode(diags, jsonObject);
+    [inputStream close];
+    return node;
 }
 
 Node readJSON(Diagnostics& diags, const void * contents, size_t length) {
-    Node resultNode;
-
-    @autoreleasepool {
-        NSData* data = [NSData dataWithBytes:contents length:length];
-        NSError* error = nil;
-        id jsonObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error];
-        if (!jsonObject) {
-            diags.error("Could not deserialize json because '%s'\n", [[error debugDescription] UTF8String]);
-            return Node();
-        }
-
-        resultNode = parseNode(diags, jsonObject);
-    }
-
-    return resultNode;
+    NSData* data = [NSData dataWithBytes:contents length:length];
+    NSError* error = nil;
+    id jsonObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error];
+    if (!jsonObject) {
+        diags.error("Could not deserialize json because '%s'\n", [[error localizedFailureReason] UTF8String]);
+        return Node();
+    }
+
+    return parseNode(diags, jsonObject);
 }
 
 } //namespace json