Changeset 9146 for trunk/tools/fastdep
- Timestamp:
 - Aug 28, 2002, 4:12:55 AM (23 years ago)
 - File:
 - 
      
- 1 edited
 
- 
          
  trunk/tools/fastdep/fastdep.c (modified) (6 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
trunk/tools/fastdep/fastdep.c
r9145 r9146 1 /* $Id: fastdep.c,v 1.4 0 2002-08-27 21:48:45 bird Exp $1 /* $Id: fastdep.c,v 1.41 2002-08-28 02:12:55 bird Exp $ 2 2 * 3 3 * Fast dependents. (Fast = Quick and Dirty!) … … 3781 3781 int iHistory; 3782 3782 int j; 3783 int k; 3783 int iStart; 3784 int iEnd; 3784 3785 int iCmp; 3785 3786 #endif … … 3827 3828 * Check if in history, if so we'll skip it. 3828 3829 */ 3829 #if 13830 #if 0 3830 3831 for (j = 0; j < iHistory; j++) 3831 3832 if (!strcmp(apszHistory[j], pdep->pszRule)) 3832 3833 break; 3833 3834 if (j != iHistory) 3834 continue; 3835 continue; /* found */ 3835 3836 3836 3837 /* … … 3841 3842 3842 3843 #else 3844 3843 3845 /* 3844 3846 * Check if in history, if so we'll skip it. … … 3846 3848 * ASSUMES: Always something in the history! 3847 3849 */ 3850 iEnd = iHistory - 1; 3851 iStart = 0; 3848 3852 j = iHistory / 2; 3849 k = (iHistory + 1) / 2;3850 do3853 while ( (iCmp = strcmp(pdep->pszRule, apszHistory[j])) != 0 3854 && iEnd != iStart) 3851 3855 { 3852 iCmp = strcmp(pdep->pszRule, apszHistroy[j]); 3853 if (!iCmp) 3856 if (iCmp < 0) 3857 iEnd = j - 1; 3858 else 3859 iStart = j + 1; 3860 if (iStart > iEnd) 3854 3861 break; 3855 k = (k + 1) / 2; 3856 if (iCmp > 0) 3857 j += k; 3858 else 3859 j -= k; 3860 } while (!k); 3861 3862 if (!iCmp) 3862 j = (iStart + iEnd) / 2; 3863 } 3864 3865 if (!iCmp) 3863 3866 continue; /* found */ 3864 3867 … … 3868 3871 if (iHistory < HISTORY) 3869 3872 { 3873 int k; 3870 3874 if (iCmp > 0) /* Insert after. */ 3871 3875 j++; 3872 for (k = iHistory; k < j; k--)3876 for (k = iHistory; k > j; k--) 3873 3877 apszHistory[k] = apszHistory[k - 1]; 3874 3878 apszHistory[j] = pdep->pszRule;  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  