Branch: Tag:

2014-12-04

2014-12-04 19:23:37 by Martin Nilsson <nilsson@opera.com>

Let the empty string be part of every string. This fixes test cases for replace, has_prefix and has_suffix. Removed redundant check.

123:   {    INT32 max1, min1;    INT32 max2, min2; +  if( !str2->len ) return 1; /* Empty string is part of every string */    check_string_range( str1, 1, &min1, &max1 );    check_string_range( str2, 1, &min2, &max2 );    if( (min2 < min1) || (max2 > max1) )
133:    /* fallback to simple size-shift check. */    return str1->size_shift >= str2->size_shift;    } -  if( (min2 < min1) || (max2 > max1) ) -  return 0; +     return 1;   }