pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:1509:   }         /* does not take locale into account */   ptrdiff_t generic_quick_binary_strcmp(const char *a,    ptrdiff_t alen, int asize,    const char *b,    ptrdiff_t blen, int bsize)   {    if(!asize && !bsize) -  { -  int tmp; -  if(alen > blen) -  { -  tmp=memcmp(a, b, blen); -  if(tmp) return tmp; -  return 1; -  }else if(alen < blen){ -  tmp=memcmp(a, b, alen); -  if(tmp) return tmp; -  return -1; -  }else{ -  return memcmp(a, b, alen); -  } -  }else{ +  return low_quick_binary_strcmp(a, alen, b, blen); +     ptrdiff_t pos;    for(pos=0;pos< MINIMUM(alen,blen) ;pos++)    {    p_wchar2 ac=generic_extract(a,asize,pos);    p_wchar2 bc=generic_extract(b,bsize,pos);    if(ac != bc) {    if (ac < bc) return -1;    return 1;    }    }    return alen-blen;   } - } +       /* Does not take locale into account    *    * Similar to (and could be used in place of) generic_quick_binary_strcmp(),    * but returns +/- (offset + 1) to the first difference beween the strings.    *    * This can be used by eg replace_many() to speed up the comparisons.    */   ptrdiff_t generic_find_binary_prefix(const char *a,    ptrdiff_t alen, int asize,