From 8fe85e764f52f0f62377ef34148dcba25b968506 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Sat, 24 Jan 2015 15:12:29 +1300 Subject: [PATCH] Eliminate "found" flag for simpler, clearer code --- Lib/swiginit.swg | 9 +++------ 1 file 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;