Changeset 2806


Ignore:
Timestamp:
2001-10-30T09:18:23+13:00 (20 years ago)
Author:
kjm18
Message:

changed initialisation loops to memset

File:
1 edited

Legend:

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

    r2801 r2806  
    137137  // Initialise the candidates, check array, and various variables.
    138138  sort(candidates.begin(), candidates.end(), isShorter);
    139   for (cellcount j = 0; j < inputLength; j++)
    140     suffixCheck[j] = 0;
     139  memset(suffixCheck, 0, sizeof(check)*inputLength);
     140  //for (cellcount j = 0; j < inputLength; j++)
     141  //  suffixCheck[j] = 0;
    141142  unsigned minimum_length = candidates.begin()->length;
    142143 
     
    333334
    334335  // Initialise the document frequency array
    335   for (cellindex i = 0; i < numberOfDocuments; i++) {
    336     frequency[i] = 0;
    337   }
     336  //  for (cellindex i = 0; i < numberOfDocuments; i++) {
     337  // frequency[i] = 0;
     338  //}
     339  memset(frequency, 0, sizeof(cellcount)*numberOfDocuments);
    338340
    339341  // variables used to facilitate the search
     
    455457
    456458  // to begin with, everything is empty
    457   for (cellcount i = 0; i < inputLength; i++) {
    458     phraseMemory[i] = 0;
    459   }
    460 
     459  //  for (cellcount i = 0; i < inputLength; i++) {
     460  // phraseMemory[i] = 0;
     461  //}
     462  memset(phraseMemory, 0, sizeof(char)*inputLength);
     463 
    461464  // intialise the hashTable of long phrases
    462465  initialiseLongPhraseMemory();
     
    788791    exit(2);
    789792  } 
    790   for (cellcount j = 0; j < contentLength; j++)
    791     suffixCheck[j] = 0;
     793  //for (cellcount j = 0; j < contentLength; j++)
     794  //  suffixCheck[j] = 0;
     795  memset(suffixCheck, 0, sizeof(check)*contentLength);
    792796
    793797  cout <<"\ngenerating the phrase hierarchy\n\n";
Note: See TracChangeset for help on using the changeset viewer.