dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/image meta_index.c,1.4,1.5


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/image meta_index.c,1.4,1.5
Date: Fri, 14 Feb 2003 21:38:57 -0500

Update of /cvsroot/dotgnu-pnet/pnet/image
In directory subversions:/tmp/cvs-serv4066/image

Modified Files:
        meta_index.c 
Log Message:


ILImageSearchForToken: unwind the token retrieval code a little to
speed up token searching.


Index: meta_index.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/meta_index.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** meta_index.c        7 Feb 2003 11:31:30 -0000       1.4
--- meta_index.c        15 Feb 2003 02:38:54 -0000      1.5
***************
*** 1288,1295 ****
--- 1288,1297 ----
        ILToken left, right;
        void *item;
+       void **data;
        int cmp;
  
        /* Find the table in question */
        maxToken = (tokenType | image->tokenCount[tokenType >> 24]);
+       data = image->tokenData[tokenType >> 24];
  
        /* Is the table sorted? */
***************
*** 1329,1336 ****
                for(token = (tokenType | 1); token <= maxToken; ++token)
                {
!                       item = ILImageTokenInfo(image, token);
!                       if(item && (*compareFunc)(item, userData) == 0)
                        {
!                               return item;
                        }
                }
--- 1331,1348 ----
                for(token = (tokenType | 1); token <= maxToken; ++token)
                {
!                       if(data && (item = data[(token & ~IL_META_TOKEN_MASK) - 
1]) != 0)
                        {
!                               if((*compareFunc)(item, userData) == 0)
!                               {
!                                       return item;
!                               }
!                       }
!                       else
!                       {
!                               item = ILImageTokenInfo(image, token);
!                               if(item && (*compareFunc)(item, userData) == 0)
!                               {
!                                       return item;
!                               }
                        }
                }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]