diff options
author | Olly Betts <olly@survex.com> | 2015-01-24 15:12:29 +1300 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2015-01-24 15:12:29 +1300 |
commit | 8fe85e764f52f0f62377ef34148dcba25b968506 (patch) | |
tree | f9e2d52f20b1dd85670f8587f1d3e37507acb7c2 /Lib/swiginit.swg | |
parent | 2a4317802123feeb4e9f57952283312c8308066e (diff) | |
download | swig-8fe85e764f52f0f62377ef34148dcba25b968506.tar.gz |
Eliminate "found" flag for simpler, clearer code
Diffstat (limited to 'Lib/swiginit.swg')
-rw-r--r-- | Lib/swiginit.swg | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/swiginit.swg b/Lib/swiginit.swg index 059355a0f..cb72c36eb 100644 --- a/Lib/swiginit.swg +++ b/Lib/swiginit.swg @@ -55,7 +55,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found, init; + int init; /* check to see if the circular list has been setup, if not, set it up */ if (swig_module.next==0) { @@ -76,18 +76,15 @@ SWIG_InitializeModule(void *clientdata) { SWIG_SetModule(clientdata, &swig_module); } else { /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - found=0; iter=module_head; do { if (iter==&swig_module) { - found=1; - break; + /* Our module is already in the list, so there's nothing more to do. */ + return; } iter=iter->next; } while (iter!= module_head); - /* if this module is already in the list, there's nothing more to do. */ - if (found) return; /* otherwise we must add our module into the list */ swig_module.next = module_head->next; module_head->next = &swig_module; |