Changeset 2704


Ignore:
Timestamp:
2001-08-19T10:37:04+12:00 (23 years ago)
Author:
paynter
Message:

Small efficiency gain in expandWhileUniqueSuffixExpansion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/phind/generate/phrase.cpp

    r2694 r2704  
    744744
    745745int Phrase::expandWhileUniqueSuffixExtension() {
    746   assert(forward);
    747746  ensureSuffixFound();
    748747
    749748  // if the phrase occurs only once, do nothing
    750   if (suffixFrequency < 2) {
     749  if (suffixFrequency < 2)
    751750    return 0;
    752   }
     751
     752  // if we already know there's no unique suffix extension, do nothing
     753  if (uniqueSuffixExtension == 0)
     754    return 0;
    753755
    754756  // count the length over which the cells are the same
     
    785787
    786788int Phrase::expandWhileUniquePrefixExtension() {
    787   assert(forward);
    788789  ensurePrefixFound();
    789790
    790791  // if the phrase occurs only once, do nothing
    791   if (prefixFrequency < 2) {
     792  if (prefixFrequency < 2)
    792793    return 0;
    793   }
     794
     795  // if we already know there's no unique extension, do nothing
     796  if (uniquePrefixExtension == 0)
     797    return 0;
    794798
    795799  // count the length over which the cells are the same
Note: See TracChangeset for help on using the changeset viewer.