From 72c6a6b441d4092364f480c32fe43cb69a23e18e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=BCkki=20D=C3=A1niel?= Date: Wed, 1 May 2024 20:06:22 +0200 Subject: [PATCH] isSingletonResult is renamed to isSingleResult. --- parser/src/sourcemanager.cpp | 2 +- util/include/util/dbutil.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/parser/src/sourcemanager.cpp b/parser/src/sourcemanager.cpp index af507ec12..73868e859 100644 --- a/parser/src/sourcemanager.cpp +++ b/parser/src/sourcemanager.cpp @@ -241,7 +241,7 @@ void SourceManager::removeFile(const model::File& file_) { odb::result relFiles = _db->query( odb::query::content == file_.content.object_id()); - if (util::isSingletonResult(relFiles)) + if (util::isSingleResult(relFiles)) { removeContent = true; _db->erase(file_.content.object_id()); diff --git a/util/include/util/dbutil.h b/util/include/util/dbutil.h index 314ce0676..5d1c331d5 100644 --- a/util/include/util/dbutil.h +++ b/util/include/util/dbutil.h @@ -98,20 +98,20 @@ inline std::string getDbDriver() } /// @brief Determines if the specified ODB query result only contains -/// a single entity. That single entity is then stored in 'singleton_'. +/// a single entity. That single entity is then stored in 'single_'. /// @tparam TEntity The type of entities in the query result. /// @param result_ The ODB query result in question. -/// @param singleton_ The variable that receives the first entity (if any). -/// @return Returns true if 'result_' only contained 'singleton_'; +/// @param single_ The variable that receives the first entity (if any). +/// @return Returns true if 'result_' only contained 'single_'; /// otherwise false. template -bool isSingletonResult(odb::result& result_, TEntity& singleton_) +bool isSingleResult(odb::result& result_, TEntity& single_) { auto it_b = result_.begin(); const auto it_e = result_.end(); if (it_b != it_e) { - singleton_ = *it_b; + single_ = *it_b; return ++it_b == it_e; } else return false; @@ -124,7 +124,7 @@ bool isSingletonResult(odb::result& result_, TEntity& singleton_) /// @return Returns true if 'result_' only contained a single entity; /// otherwise false. template -bool isSingletonResult(odb::result& result_) +bool isSingleResult(odb::result& result_) { auto it_b = result_.begin(); const auto it_e = result_.end();