Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fac00b2

Browse files
committed
Use NSEnumerator instead of objectAtIndex
1 parent 2eb6b91 commit fac00b2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/_macosx.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5760,11 +5760,12 @@ - (int)index
57605760
if(nwin > 0)
57615761
{
57625762
[NSApp activateIgnoringOtherApps: YES];
5763-
NSArray *windowsArray = [[NSApp windows] retain];
5764-
for (int i = 0; i < [windowsArray count]; i++) {
5765-
[[windowsArray objectAtIndex:i] orderFront:nil];
5763+
NSArray *windowsArray = [NSApp windows];
5764+
NSEnumerator *enumerator = [windowsArray objectEnumerator];
5765+
NSWindow *window;
5766+
while ((window = [enumerator nextObject])) {
5767+
[window orderFront:nil];
57665768
}
5767-
[windowsArray release];
57685769
[NSApp run];
57695770
}
57705771
Py_INCREF(Py_None);

0 commit comments

Comments
 (0)