Module: sems
Branch: master
Commit: 824d778f1611cc47f2baa0668cbe3159dbbe72fb
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=824d778f1611cc47f2baa0668cbe3159dbbe72fb

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Thu Aug  9 17:49:20 2012 +0200

simplified singleton instance() function

as suggested by Robert

---

 core/singleton.h |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/core/singleton.h b/core/singleton.h
index 158b6f5..e46d13b 100644
--- a/core/singleton.h
+++ b/core/singleton.h
@@ -14,14 +14,12 @@ public:
   static singleton<T>* instance() 
   {
     _inst_m.lock();
-    if(!_instance) {
+    if(NULL == _instance) {
       _instance = new singleton<T>();
     }
-
-    singleton<T>* ret = _instance;
     _inst_m.unlock();
 
-    return ret;
+    return _instance;
   }
 
   static bool haveInstance()

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to