Use Strchr/strchr instead of Strstr/strstr when searching for a single

character.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9334 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2006-09-23 22:36:23 +00:00
commit b17fcc97f7
11 changed files with 38 additions and 38 deletions

View file

@ -327,7 +327,7 @@ class Allocate : public Dispatcher {
if (!name) continue;
String *base_decl = Getattr(nn,"decl");
if (base_decl) base_decl = SwigType_typedef_resolve_all(base_decl);
if (Strstr(name,"~")) continue; /* Don't care about destructors */
if (Strchr(name,'~')) continue; /* Don't care about destructors */
if (SwigType_isfunction(base_decl)) {
search_decl = SwigType_pop_function(base_decl);

View file

@ -89,15 +89,15 @@ Hash *Contracts::ContractSplit(Node *n) {
Iterator i;
for (i = First(l); i.item; i = Next(i)) {
int found = 0;
if (Strstr(i.item,"{")) continue;
if (Strstr(i.item,"}")) continue;
if (Strchr(i.item,'{')) continue;
if (Strchr(i.item,'}')) continue;
for (int j = 0; Rules[j].section; j++) {
if (Strstr(i.item,Rules[j].section)) {
if (Len(current_section)) {
Setattr(result,current_section_name,current_section);
current_section = Getattr(result,Rules[j].section);
if (!current_section) current_section = NewString("");
}
}
current_section_name = Rules[j].section;
found = 1;
break;