Changeset 2850 for trunk/src/kmk/dir.c


Ignore:
Timestamp:
Aug 30, 2016, 6:06:31 PM (9 years ago)
Author:
bird
Message:

kmk: optimizations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/dir.c

    r2773 r2850  
    594594          if (HASH_VACANT (dc))
    595595            {
     596#if defined(WINDOWS32) && defined(KMK)
     597              static char s_last_volume[4];
     598              static int  s_last_flags;
     599#endif
    596600              /* Nope; this really is a directory we haven't seen before.  */
    597601
     
    625629               */
    626630              w32_path[3] = '\0';
     631# ifdef KMK /* Need for speed: Cache the GetVolumeInformation result. */
     632              if (   s_last_volume[0] == w32_path[0]
     633                  && s_last_volume[1] == w32_path[1]
     634                  && s_last_volume[2] == w32_path[2]
     635                  && s_last_volume[3] == w32_path[3])
     636                dc->fs_flags = s_last_flags;
     637              else
     638                {
     639# endif
    627640              if (GetVolumeInformation(w32_path,
    628641                     fs_label, sizeof (fs_label),
     
    636649              else
    637650                dc->fs_flags = FS_UNKNOWN;
     651# ifdef KMK
     652                  s_last_volume[0] = w32_path[0];
     653                  s_last_volume[1] = w32_path[1];
     654                  s_last_volume[2] = w32_path[2];
     655                  s_last_volume[3] = w32_path[3];
     656                  s_last_flags     = dc->fs_flags;
     657                }
     658# endif
    638659#else
    639660# ifdef VMS
Note: See TracChangeset for help on using the changeset viewer.