Skip to content

Commit

Permalink
Update to Objective-C object subscripting
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelglow committed Oct 4, 2013
1 parent 5b64e62 commit 917f42a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Require
* *Foundation.framework*
* *libc++.dylib* if your project doesn't already use C++ or Objective-C++.
* *libz.dylib*
* **Run**: Mac OS X 10.7 (Lion) or iOS 4.0 and later.
* **Run**: Mac OS X 10.7 (Lion) or iOS 5.0 and later.

Support
-------
Expand Down
8 changes: 4 additions & 4 deletions zipzap/ZZArchive.mm
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ - (BOOL)updateEntries:(NSArray*)newEntries
NSUInteger newEntriesCount = newEntries.count;
NSUInteger skipIndex;
for (skipIndex = 0; skipIndex < std::min(oldEntriesCount, newEntriesCount); ++skipIndex)
if ([newEntries objectAtIndex:skipIndex] != [_entries objectAtIndex:skipIndex])
if (newEntries[skipIndex] != _entries[skipIndex])
break;

// get an entry writer for each new entry
Expand All @@ -189,7 +189,7 @@ - (BOOL)updateEntries:(NSArray*)newEntries
}];

// skip the initial matching entries
uint32_t initialSkip = skipIndex > 0 ? [[newEntryWriters objectAtIndex:skipIndex - 1] offsetToLocalFileEnd] : 0;
uint32_t initialSkip = skipIndex > 0 ? [newEntryWriters[skipIndex - 1] offsetToLocalFileEnd] : 0;

NSError* __autoreleasing underlyingError;

Expand All @@ -209,7 +209,7 @@ - (BOOL)updateEntries:(NSArray*)newEntries
{
// write out local files
for (NSUInteger index = skipIndex; index < newEntriesCount; ++index)
if (![[newEntryWriters objectAtIndex:index] writeLocalFileToChannelOutput:temporaryChannelOutput
if (![newEntryWriters[index] writeLocalFileToChannelOutput:temporaryChannelOutput
withInitialSkip:initialSkip
error:&underlyingError])
return ZZRaiseError(error, ZZLocalFileWriteErrorCode, @{NSUnderlyingErrorKey : underlyingError, ZZEntryIndexKey : @(index)});
Expand All @@ -226,7 +226,7 @@ - (BOOL)updateEntries:(NSArray*)newEntries

// write out central file headers
for (NSUInteger index = 0; index < newEntriesCount; ++index)
if (![[newEntryWriters objectAtIndex:index] writeCentralFileHeaderToChannelOutput:temporaryChannelOutput
if (![newEntryWriters[index] writeCentralFileHeaderToChannelOutput:temporaryChannelOutput
error:&underlyingError])
return ZZRaiseError(error, ZZCentralFileHeaderWriteErrorCode, @{NSUnderlyingErrorKey : underlyingError, ZZEntryIndexKey : @(index)});

Expand Down

0 comments on commit 917f42a

Please sign in to comment.