Revision: 7611
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7611&view=rev
Author:   hofman
Date:     2011-12-29 12:20:27 +0000 (Thu, 29 Dec 2011)
Log Message:
-----------
create static variable in initialize

Modified Paths:
--------------
    trunk/SKTypeSelectHelper.m

Modified: trunk/SKTypeSelectHelper.m
===================================================================
--- trunk/SKTypeSelectHelper.m  2011-12-29 11:27:55 UTC (rev 7610)
+++ trunk/SKTypeSelectHelper.m  2011-12-29 12:20:27 UTC (rev 7611)
@@ -73,7 +73,13 @@
 
 @synthesize delegate, searchString, matchOption, isProcessing;
 
+static NSCharacterSet *nonAlphanumericCharacterSet = nil;
 
++ (void)initialize {
+    SKINITIALIZE;
+    nonAlphanumericCharacterSet = [[[NSCharacterSet alphanumericCharacterSet] 
invertedSet] copy];
+}
+
 + (id)typeSelectHelper {
     return [[[self alloc] init] autorelease];
 }
@@ -189,10 +195,6 @@
     if ([keyEvent deviceIndependentModifierFlags] & ~NSShiftKeyMask & 
~NSAlternateKeyMask & ~NSAlphaShiftKeyMask & ~NSNumericPadKeyMask)
         return NO;
     
-    static NSCharacterSet *nonAlphanumericCharacterSet = nil;
-    if (nonAlphanumericCharacterSet == nil)
-        nonAlphanumericCharacterSet = [[[NSCharacterSet 
alphanumericCharacterSet] invertedSet] copy];
-    
     NSCharacterSet *invalidCharacters = [self isProcessing] ? [NSCharacterSet 
controlCharacterSet] : nonAlphanumericCharacterSet;
     
     return [[keyEvent characters] 
rangeOfCharacterFromSet:invalidCharacters].location == NSNotFound;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to