From 41640c1399f7392988f2519ed9df695301edb33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Thu, 4 Feb 2021 17:04:22 +0800 Subject: [PATCH] code opt --- doric-Qt/doric/template/DoricSingleton.h | 4 ++-- doric-Qt/doric/utils/DoricObjectFactory.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doric-Qt/doric/template/DoricSingleton.h b/doric-Qt/doric/template/DoricSingleton.h index 4c4eea1d..d6542cc4 100644 --- a/doric-Qt/doric/template/DoricSingleton.h +++ b/doric-Qt/doric/template/DoricSingleton.h @@ -12,8 +12,8 @@ private: public: static DoricSingleton *getInstance() { - static DoricSingleton locla_s; - return &locla_s; + static DoricSingleton instance; + return &instance; } }; diff --git a/doric-Qt/doric/utils/DoricObjectFactory.h b/doric-Qt/doric/utils/DoricObjectFactory.h index 8936fa32..55000621 100644 --- a/doric-Qt/doric/utils/DoricObjectFactory.h +++ b/doric-Qt/doric/utils/DoricObjectFactory.h @@ -1,10 +1,10 @@ +#ifndef OBJECTFACTORY_H +#define OBJECTFACTORY_H + #include #include #include -#ifndef OBJECTFACTORY_H -#define OBJECTFACTORY_H - class DoricObjectFactory { public: template static void registerClass(QString name) {