comparison src/search.c @ 4904:e91e3e353805

Don't compare the same octet with itself if checking for boyer_moore_ok src/ChangeLog addition: 2010-01-31 Aidan Kehoe <kehoea@parhasard.net> * search.c (search_buffer): When checking the octets of c for identity, don't compare the same octet with itself. Thank you Ben Wing! tests/ChangeLog addition: 2010-01-31 Aidan Kehoe <kehoea@parhasard.net> * automated/search-tests.el: Check that multidimensional characters with repeated octets and case information force simple_search(), since boyer_moore() doesn't understand them when constructing its stride table. In passing; correct my spelling. * automated/case-tests.el (uni-mappings): In passing; delete a couple of redundant tests, correct the logic of another.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 31 Jan 2010 18:09:57 +0000
parents 7504864a986c
children e813cf16c015
comparison
equal deleted inserted replaced
4903:70089046adef 4904:e91e3e353805
1439 Ibyte encoded[MAX_ICHAR_LEN]; 1439 Ibyte encoded[MAX_ICHAR_LEN];
1440 Bytecount len = set_itext_ichar (encoded, c); 1440 Bytecount len = set_itext_ichar (encoded, c);
1441 int i, j; 1441 int i, j;
1442 for (i = 0; i < len && boyer_moore_ok; ++i) 1442 for (i = 0; i < len && boyer_moore_ok; ++i)
1443 { 1443 {
1444 for (j = 0; i < len && boyer_moore_ok; ++j) 1444 for (j = i + 1; j < len && boyer_moore_ok; ++j)
1445 { 1445 {
1446 if (encoded[i] == encoded[j]) 1446 if (encoded[i] == encoded[j])
1447 { 1447 {
1448 boyer_moore_ok = 0; 1448 boyer_moore_ok = 0;
1449 } 1449 }