ソースを参照

Increase IOS ASCII readFile performance

Ben Hsieh 8 年 前
コミット
8cb1d712d4
共有1 個のファイルを変更した6 個の追加6 個の削除を含む
  1. 6
    6
      src/ios/RNFetchBlobFS.m

+ 6
- 6
src/ios/RNFetchBlobFS.m ファイルの表示

@@ -341,13 +341,13 @@ NSMutableDictionary *fileStreams = nil;
341 341
                     resolve([fileContent base64EncodedStringWithOptions:0]);
342 342
             }
343 343
             else if ([[encoding lowercaseString] isEqualToString:@"ascii"]) {
344
-                NSMutableArray * resultArray = [NSMutableArray array];
345
-                char * bytes = [fileContent bytes];
346
-                for(int i=0;i<[fileContent length];i++) {
347
-                    [resultArray addObject:[NSNumber numberWithChar:bytes[i]]];
348
-                }
344
+//                NSMutableArray * resultArray = [NSMutableArray array];
345
+//                char * bytes = [fileContent bytes];
346
+//                for(int i=0;i<[fileContent length];i++) {
347
+//                    [resultArray addObject:[NSNumber numberWithChar:bytes[i]]];
348
+//                }
349 349
                 if(resolve != nil)
350
-                    resolve(resultArray);
350
+                    resolve([[NSString alloc] initWithData:fileContent encoding:NSASCIIStringEncoding]);
351 351
             }
352 352
         }];
353 353
     }