diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2022-11-23 19:57:20 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2022-11-23 20:22:40 +0000 |
commit | d3095144e1c04b4e8c33fd43ad08b9db9f63b084 (patch) | |
tree | 12d1f3bf33913198f09462d2a227ddd7bf7b1db8 /Source/Swig | |
parent | e0904f44eb1eed9913bb8c93452d7662ea5b2c6f (diff) | |
download | swig-d3095144e1c04b4e8c33fd43ad08b9db9f63b084.tar.gz |
Optimise SwigType_base implementation
Also fixes assumption that templates start '<' instead of '<('.
Checked java and python test-suite - no changes in output.
Diffstat (limited to 'Source/Swig')
-rw-r--r-- | Source/Swig/typeobj.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/Source/Swig/typeobj.c b/Source/Swig/typeobj.c index 584e2424b..088497fa5 100644 --- a/Source/Swig/typeobj.c +++ b/Source/Swig/typeobj.c @@ -1181,20 +1181,9 @@ SwigType *SwigType_base(const SwigType *t) { c++; continue; } - if (*c == '<') { - /* Skip over template---it's part of the base name */ - int ntemp = 1; - c++; - while ((*c) && (ntemp > 0)) { - if (*c == '>') - ntemp--; - else if (*c == '<') - ntemp++; - c++; - } - if (ntemp) - break; - continue; + if (*c == '<' && *(c + 1) == '(') { + /* start of template parameters --- the remainder is part of the base */ + break; } if (*c == '(') { /* Skip over params */ |