mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 14:02:28 +00:00
Fixes possible issues with wrong initial capacities
This commit is contained in:
Submodule KeePassKit updated: c5368d2d8b...22cd576d7c
@@ -96,7 +96,7 @@
|
||||
if(![context isValid]) {
|
||||
return nil;
|
||||
}
|
||||
NSUInteger reserverd = [context.normalizedCommand length] / 4;
|
||||
NSUInteger reserverd = MAX(1,[context.normalizedCommand length] / 4);
|
||||
NSMutableArray *commands = [[NSMutableArray alloc] initWithCapacity:reserverd];
|
||||
NSMutableArray __block *commandRanges = [[NSMutableArray alloc] initWithCapacity:reserverd];
|
||||
NSRegularExpression *commandRegExp = [[NSRegularExpression alloc] initWithPattern:@"\\{[^\\}]+\\}" options:NSRegularExpressionCaseInsensitive error:0];
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
return nil;
|
||||
}
|
||||
NSArray *autotypeEntries = [self.root autotypeableChildEntries];
|
||||
NSMutableArray *contexts = [[NSMutableArray alloc] initWithCapacity:ceil([autotypeEntries count] / 4.0)];
|
||||
NSMutableArray *contexts = [[NSMutableArray alloc] initWithCapacity:MAX(1,ceil([autotypeEntries count] / 4.0))];
|
||||
for(KPKEntry *entry in autotypeEntries) {
|
||||
/* Test for title */
|
||||
NSRange titleRange = [entry.title rangeOfString:windowTitle options:NSCaseInsensitiveSearch];
|
||||
|
||||
Reference in New Issue
Block a user