[Bf-blender-cvs] [c1ba68dd042] master: Cleanup: use arrayWithObject to reduce the code

Yuki Hashimoto noreply at git.blender.org
Mon Jul 5 13:10:50 CEST 2021


Commit: c1ba68dd042c86c6650dad534bdb3687c3a8f621
Author: Yuki Hashimoto
Date:   Mon Jul 5 12:57:28 2021 +0200
Branches: master
https://developer.blender.org/rBc1ba68dd042c86c6650dad534bdb3687c3a8f621

Cleanup: use arrayWithObject to reduce the code

Similar code is found in Apple's code samples.

Differential Revision: https://developer.blender.org/D11434

===================================================================

M	intern/ghost/intern/GHOST_WindowViewCocoa.h

===================================================================

diff --git a/intern/ghost/intern/GHOST_WindowViewCocoa.h b/intern/ghost/intern/GHOST_WindowViewCocoa.h
index f47e02704b2..b94f46b6e63 100644
--- a/intern/ghost/intern/GHOST_WindowViewCocoa.h
+++ b/intern/ghost/intern/GHOST_WindowViewCocoa.h
@@ -74,12 +74,7 @@
     composing = YES;
 
     // interpret event to call insertText
-    NSMutableArray *events;
-    events = [[NSMutableArray alloc] initWithCapacity:1];
-    [events addObject:event];
-    [self interpretKeyEvents:events];  // calls insertText
-    [events removeObject:event];
-    [events release];
+    [self interpretKeyEvents:[NSArray arrayWithObject:event]];  // calls insertText
     return;
   }
 }



More information about the Bf-blender-cvs mailing list