Skip to content

Commit 9d5d84b

Browse files
author
Brandon McQuilkin
committed
Merge pull request #13 from mattquiros/master
Fixed insertion errors where insertion index is wrong
2 parents 648b615 + b1d6cff commit 9d5d84b

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

.DS_Store

0 Bytes
Binary file not shown.

M13OrderedDictionary.m

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -920,18 +920,13 @@ - (void)addEntriesFromDictionary:(NSDictionary *)dictionary
920920

921921
- (void)insertObject:(id)object pairedWithKey:(id<NSCopying>)key atIndex:(NSUInteger)index
922922
{
923-
NSInteger idx = 0;
924923
if ([pairs objectForKey:key] != nil) {
925-
if (index < [self indexOfKey:key]) {
926-
idx = index - 1;
927-
} else {
928-
idx = index;
929-
}
930924
[self removeEntryWithKey:key];
931925
}
926+
932927
[pairs setObject:object forKey:key];
933-
[keys insertObject:key atIndex:idx];
934-
[objects insertObject:object atIndex:idx];
928+
[keys insertObject:key atIndex:index];
929+
[objects insertObject:object atIndex:index];
935930
}
936931

937932
- (void)insertEntry:(NSDictionary *)entry atIndex:(NSUInteger)index

M13OrderedDictionary.xcodeproj/project.xcworkspace/xcshareddata/M13OrderedDictionary.xccheckout

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,34 @@
55
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
66
<false/>
77
<key>IDESourceControlProjectIdentifier</key>
8-
<string>87933A7B-DEEA-45D2-A9C9-ECFD42622B81</string>
8+
<string>A2290859-C43C-433C-B549-1EE23115D3CB</string>
99
<key>IDESourceControlProjectName</key>
1010
<string>M13OrderedDictionary</string>
1111
<key>IDESourceControlProjectOriginsDictionary</key>
1212
<dict>
13-
<key>2A58D87D-0C3D-4E3E-B996-44464EA9164D</key>
14-
<string>https://github.com/Marxon13/M13OrderedDictionary.git</string>
13+
<key>5CBA84AC-2517-437E-8596-079CE4775AC9</key>
14+
<string>https://github.com/mattquiros/M13OrderedDictionary.git</string>
1515
</dict>
1616
<key>IDESourceControlProjectPath</key>
1717
<string>M13OrderedDictionary.xcodeproj/project.xcworkspace</string>
1818
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
1919
<dict>
20-
<key>2A58D87D-0C3D-4E3E-B996-44464EA9164D</key>
20+
<key>5CBA84AC-2517-437E-8596-079CE4775AC9</key>
2121
<string>../..</string>
2222
</dict>
2323
<key>IDESourceControlProjectURL</key>
24-
<string>https://github.com/Marxon13/M13OrderedDictionary.git</string>
24+
<string>https://github.com/mattquiros/M13OrderedDictionary.git</string>
2525
<key>IDESourceControlProjectVersion</key>
2626
<integer>110</integer>
2727
<key>IDESourceControlProjectWCCIdentifier</key>
28-
<string>2A58D87D-0C3D-4E3E-B996-44464EA9164D</string>
28+
<string>5CBA84AC-2517-437E-8596-079CE4775AC9</string>
2929
<key>IDESourceControlProjectWCConfigurations</key>
3030
<array>
3131
<dict>
3232
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
3333
<string>public.vcs.git</string>
3434
<key>IDESourceControlWCCIdentifierKey</key>
35-
<string>2A58D87D-0C3D-4E3E-B996-44464EA9164D</string>
35+
<string>5CBA84AC-2517-437E-8596-079CE4775AC9</string>
3636
<key>IDESourceControlWCCName</key>
3737
<string>M13OrderedDictionary</string>
3838
</dict>

0 commit comments

Comments
 (0)