Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 6334caa

Browse files
committed
Remove redundant code.
1 parent faa2981 commit 6334caa

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/ios/RNFetchBlobFS.m

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,14 @@ - (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode {
370370

371371
switch(eventCode) {
372372

373-
// write stream event
373+
// write stream event
374374
case NSStreamEventHasSpaceAvailable:
375375
{
376376

377377

378378
}
379379

380-
// read stream incoming chunk
380+
// read stream incoming chunk
381381
case NSStreamEventHasBytesAvailable:
382382
{
383383
NSMutableData * chunkData = [[NSMutableData alloc] init];
@@ -386,7 +386,6 @@ - (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode {
386386
chunkSize = 4095;
387387
if(self.bufferSize > 0)
388388
chunkSize = self.bufferSize;
389-
// uint8_t * buf = (uint8_t *)malloc(chunkSize);
390389
uint8_t buf[chunkSize];
391390
unsigned int len = 0;
392391
len = [(NSInputStream *)stream read:buf maxLength:chunkSize];
@@ -420,10 +419,6 @@ - (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode {
420419
@"detail": asciiArray
421420
}
422421
];
423-
// free(buf);
424-
// asciiStr = nil;
425-
// buf = nil;
426-
// chunkData = nil;
427422
return;
428423
}
429424
// convert byte array to base64 data chunks
@@ -449,8 +444,6 @@ - (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode {
449444
@"detail": encodedChunk
450445
}
451446
];
452-
// chunkData = nil;
453-
// free(buf);
454447
}
455448
// end of stream
456449
else {
@@ -461,13 +454,11 @@ - (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode {
461454
@"detail": @""
462455
}
463456
];
464-
// chunkData = nil;
465-
// free(buf);
466457
}
467458
break;
468459
}
469460

470-
// stream error
461+
// stream error
471462
case NSStreamEventErrorOccurred:
472463
{
473464
[self.bridge.eventDispatcher

0 commit comments

Comments
 (0)