Ignore:
Timestamp:
2004-11-29T15:43:11+13:00 (19 years ago)
Author:
kjdon
Message:

Added the changes from Emanuel Dejanu (Simple Words) - mostly efficiency changes. For example, changing i++ to ++i, delete xxx to delete []xxx, some stuff to do with UCArrays...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mgpp/text/QueryLex.cpp

    r3365 r8692  
    2727              UCArray &text,
    2828              int len) {
     29  if (text.capacity() < text.size() + len + 1) {
     30    text.reserve(text.size + len + 1);
     31  }
    2932  while (len > 0) {
    3033    text.push_back (*here++);
    31     len--;
     34    --len;
    3235  }
    3336}
     
    148151  if (!ParseTerm (here, end, el.text)) return false;
    149152
    150   UCArray AND; SetCStr (AND, "AND");
    151   if (el.text == AND) {
     153  //UCArray AND; SetCStr (AND, "AND");
     154  //if (el.text == AND) {
     155  if (UCArrayCStrEquals(el.text, "AND")) { 
    152156    el.lexType = AndOpE;
    153157    return true;
    154158  }
    155   UCArray OR; SetCStr (OR, "OR");
    156   if (el.text == OR) {
     159  //UCArray OR; SetCStr (OR, "OR");
     160  //if (el.text == OR) {
     161  if (UCArrayCStrEquals(el.text, "OR")) {
    157162    el.lexType = OrOpE;
    158163    return true;
    159164  }
    160   UCArray NOT; SetCStr (NOT, "NOT");
    161   if (el.text == NOT) {
     165  //UCArray NOT; SetCStr (NOT, "NOT");
     166  //if (el.text == NOT) {
     167  if (UCArrayCStrEquals(el.text, "NOT")) {
    162168    el.lexType = NotOpE;
    163169    return true;
Note: See TracChangeset for help on using the changeset viewer.