Micro-optimization of cocoa event polling

This commit is contained in:
Kovid Goyal 2018-10-21 20:56:27 +05:30
parent 1d9f73adec
commit 70c9c058e2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1791,13 +1791,13 @@ void _glfwPlatformPollEvents(void)
for (;;)
{
NSEvent* event = [NSApp nextEventMatchingMask:NSEventMaskAny
untilDate:[NSDate distantPast]
untilDate:nil
inMode:NSDefaultRunLoopMode
dequeue:YES];
if (event == nil)
break;
[NSApp sendEvent:event];
if ([event type] != NSEventTypeApplicationDefined) [NSApp sendEvent:event];
}
[_glfw.ns.autoreleasePool drain];