analyzer warning: method should never return nil

This commit is contained in:
Stefan Csomor
2017-06-07 08:09:49 +02:00
parent 99c6d58359
commit c6ca6d922f

View File

@@ -548,7 +548,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
- (NSArray *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray *)words - (NSArray *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray *)words
forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger*)index forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger*)index
{ {
NSMutableArray* matches = NULL; NSMutableArray* matches = [NSMutableArray array];
wxTextWidgetImpl* impl = (wxNSTextFieldControl * ) wxWidgetImpl::FindFromWXWidget( self ); wxTextWidgetImpl* impl = (wxNSTextFieldControl * ) wxWidgetImpl::FindFromWXWidget( self );
wxTextEntry * const entry = impl->GetTextEntry(); wxTextEntry * const entry = impl->GetTextEntry();
@@ -563,7 +563,6 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
[[textView string] substringWithRange:charRange] [[textView string] substringWithRange:charRange]
); );
matches = [NSMutableArray array];
for ( ;; ) for ( ;; )
{ {
const wxString s = completer->GetNext(); const wxString s = completer->GetNext();