No real changes, just rewrite the parameter iteration loop to be more clear.

Also remove unused commented out code.
This commit is contained in:
Vadim Zeitlin 2014-07-12 20:03:26 +02:00
commit d677321323

View file

@ -242,21 +242,15 @@ std::string PyDocConverter::getParamType(std::string param)
std::string type; std::string type;
ParmList *plist = CopyParmList(Getattr(currentNode, "parms")); ParmList *plist = CopyParmList(Getattr(currentNode, "parms"));
Parm *p = NULL; for (Parm *p = plist; p;p = nextSibling(p)) {
for (p = plist; p;) { if (Char (Getattr(p, "name")) != param)
if (Char (Getattr(p, "name")) == param) { continue;
String *s = SwigType_str(Getattr(p, "type"), ""); String *s = SwigType_str(Getattr(p, "type"), "");
type = Char (s); type = Char (s);
Delete(s); Delete(s);
break; break;
} }
/*
* doesn't seem to work always: in some cases (especially for 'self' parameters)
* tmap:in is present, but tmap:in:next is not and so this code skips all the parameters
*/
//p = Getattr(p, "tmap:in") ? Getattr(p, "tmap:in:next") : nextSibling(p);
p = nextSibling(p);
}
Delete(plist); Delete(plist);
return type; return type;
} }