Browse Source

Remove redundant code.

Ben Hsieh 8 years ago
parent
commit
6334caa4ce
1 changed files with 3 additions and 12 deletions
  1. 3
    12
      src/ios/RNFetchBlobFS.m

+ 3
- 12
src/ios/RNFetchBlobFS.m View File

370
 
370
 
371
     switch(eventCode) {
371
     switch(eventCode) {
372
 
372
 
373
-            // write stream event
373
+        // write stream event
374
         case NSStreamEventHasSpaceAvailable:
374
         case NSStreamEventHasSpaceAvailable:
375
         {
375
         {
376
 
376
 
377
 
377
 
378
         }
378
         }
379
 
379
 
380
-            // read stream incoming chunk
380
+        // read stream incoming chunk
381
         case NSStreamEventHasBytesAvailable:
381
         case NSStreamEventHasBytesAvailable:
382
         {
382
         {
383
             NSMutableData * chunkData = [[NSMutableData alloc] init];
383
             NSMutableData * chunkData = [[NSMutableData alloc] init];
386
                 chunkSize = 4095;
386
                 chunkSize = 4095;
387
             if(self.bufferSize > 0)
387
             if(self.bufferSize > 0)
388
                 chunkSize = self.bufferSize;
388
                 chunkSize = self.bufferSize;
389
-//            uint8_t * buf = (uint8_t *)malloc(chunkSize);
390
             uint8_t buf[chunkSize];
389
             uint8_t buf[chunkSize];
391
             unsigned int len = 0;
390
             unsigned int len = 0;
392
             len = [(NSInputStream *)stream read:buf maxLength:chunkSize];
391
             len = [(NSInputStream *)stream read:buf maxLength:chunkSize];
420
                              @"detail": asciiArray
419
                              @"detail": asciiArray
421
                             }
420
                             }
422
                      ];
421
                      ];
423
-//                    free(buf);
424
-//                    asciiStr = nil;
425
-//                    buf = nil;
426
-//                    chunkData = nil;
427
                     return;
422
                     return;
428
                 }
423
                 }
429
                 // convert byte array to base64 data chunks
424
                 // convert byte array to base64 data chunks
449
                         @"detail": encodedChunk
444
                         @"detail": encodedChunk
450
                         }
445
                         }
451
                  ];
446
                  ];
452
-//                chunkData = nil;
453
-//                free(buf);
454
             }
447
             }
455
             // end of stream
448
             // end of stream
456
             else {
449
             else {
461
                         @"detail": @""
454
                         @"detail": @""
462
                         }
455
                         }
463
                  ];
456
                  ];
464
-//                chunkData = nil;
465
-//                free(buf);
466
             }
457
             }
467
             break;
458
             break;
468
         }
459
         }
469
 
460
 
470
-            // stream error
461
+        // stream error
471
         case NSStreamEventErrorOccurred:
462
         case NSStreamEventErrorOccurred:
472
         {
463
         {
473
             [self.bridge.eventDispatcher
464
             [self.bridge.eventDispatcher