You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by sw...@apache.org on 2022/01/02 04:01:18 UTC

[logging-log4cxx] branch next_stable updated: Improve code clarity

This is an automated email from the ASF dual-hosted git repository.

swebb2066 pushed a commit to branch next_stable
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git


The following commit(s) were added to refs/heads/next_stable by this push:
     new 2248d59  Improve code clarity
2248d59 is described below

commit 2248d595e5e3bf2ad03e504ed4ba6f5c7e6c180b
Author: Stephen Webb <swebb2066.com>
AuthorDate: Sun Jan 2 14:59:39 2022 +1100

    Improve code clarity
---
 src/main/cpp/logmanager.cpp                       | 2 +-
 src/main/include/log4cxx/helpers/aprinitializer.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/cpp/logmanager.cpp b/src/main/cpp/logmanager.cpp
index e060ea8..ca21d06 100644
--- a/src/main/cpp/logmanager.cpp
+++ b/src/main/cpp/logmanager.cpp
@@ -50,7 +50,7 @@ void* LogManager::guard = 0;
 
 RepositorySelectorPtr LogManager::getRepositorySelector()
 {
-	auto result = APRInitializer::getUnique<spi::RepositorySelector>( []() -> ObjectPtr
+	auto result = APRInitializer::getOrAddUnique<spi::RepositorySelector>( []() -> ObjectPtr
 		{
 			LoggerRepositoryPtr hierarchy = Hierarchy::create();
 			return ObjectPtr(new DefaultRepositorySelector(hierarchy));
diff --git a/src/main/include/log4cxx/helpers/aprinitializer.h b/src/main/include/log4cxx/helpers/aprinitializer.h
index 38ea5c6..c6edab0 100644
--- a/src/main/include/log4cxx/helpers/aprinitializer.h
+++ b/src/main/include/log4cxx/helpers/aprinitializer.h
@@ -65,7 +65,7 @@ class APRInitializer
 		/**
 		 *  Fetch or add a single instance type ObjectPtr for deletion prior to termination
 		 */
-		template <class T> static std::shared_ptr<T> getUnique(std::function<ObjectPtr()> creator)
+		template <class T> static std::shared_ptr<T> getOrAddUnique(std::function<ObjectPtr()> creator)
 		{
 			return cast<T>(getInstance().findOrAddObject(typeid(T).hash_code(), creator));
 		}