From 0324c90dc754fe05f853c65d90ad769fa830b4f0 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 26 Apr 2016 23:43:19 +0100 Subject: Remove unrequired wrapper functions --- .../service/maintenance/categoryMetaProcessor.cpp | 11 +++-------- gentoobrowse-api/service/maintenance/categoryMetaProcessor.h | 3 --- gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp | 10 ++-------- gentoobrowse-api/service/maintenance/packageMetaProcessor.h | 3 --- 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/gentoobrowse-api/service/maintenance/categoryMetaProcessor.cpp b/gentoobrowse-api/service/maintenance/categoryMetaProcessor.cpp index 31d2508..23d6699 100644 --- a/gentoobrowse-api/service/maintenance/categoryMetaProcessor.cpp +++ b/gentoobrowse-api/service/maintenance/categoryMetaProcessor.cpp @@ -15,12 +15,13 @@ namespace Gentoo { void CategoryMetaProcessor::created(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const { - upsert(dbc->modify(sql::maintenance::categoryMetaUpdate::sql), fn, path); + modified(dbc, fn, path); } void - CategoryMetaProcessor::upsert(DB::ModifyCommandPtr m, const boost::filesystem::path & fn, const boost::filesystem::path & path) const + CategoryMetaProcessor::modified(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const { + DB::ModifyCommandPtr m = dbc->modify(sql::maintenance::categoryMetaUpdate::sql); U::XmlDoc md(path); U::Database::bindOptionalsS(m.get(), 0, { md.getXPathValue("/catmetadata/longdescription[@lang='en']/text()"), @@ -30,12 +31,6 @@ namespace Gentoo { m->execute(); } - void - CategoryMetaProcessor::modified(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const - { - upsert(dbc->modify(sql::maintenance::categoryMetaUpdate::sql), fn, path); - } - void CategoryMetaProcessor::deleted(DB::Connection * dbc, const boost::filesystem::path & fn) const { diff --git a/gentoobrowse-api/service/maintenance/categoryMetaProcessor.h b/gentoobrowse-api/service/maintenance/categoryMetaProcessor.h index b8c457e..e335cd8 100644 --- a/gentoobrowse-api/service/maintenance/categoryMetaProcessor.h +++ b/gentoobrowse-api/service/maintenance/categoryMetaProcessor.h @@ -15,9 +15,6 @@ namespace Gentoo { void created(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const; void modified(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const; void deleted(DB::Connection * dbc, const boost::filesystem::path & fn) const; - - private: - void upsert(DB::ModifyCommandPtr m, const boost::filesystem::path & fn, const boost::filesystem::path & path) const; }; } } diff --git a/gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp b/gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp index 5c67774..f0d9405 100644 --- a/gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp +++ b/gentoobrowse-api/service/maintenance/packageMetaProcessor.cpp @@ -15,11 +15,11 @@ namespace Gentoo { void PackageMetaProcessor::created(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const { - update(dbc, fn, path); + modified(dbc, fn, path); } void - PackageMetaProcessor::update(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const + PackageMetaProcessor::modified(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const { auto m = dbc->modify(sql::maintenance::packageMetaUpdate::sql); U::XmlDoc md(path); @@ -35,12 +35,6 @@ namespace Gentoo { m->execute(); } - void - PackageMetaProcessor::modified(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const - { - update(dbc, fn, path); - } - void PackageMetaProcessor::deleted(DB::Connection * dbc, const boost::filesystem::path & fn) const { diff --git a/gentoobrowse-api/service/maintenance/packageMetaProcessor.h b/gentoobrowse-api/service/maintenance/packageMetaProcessor.h index fb5ffa7..44bb77e 100644 --- a/gentoobrowse-api/service/maintenance/packageMetaProcessor.h +++ b/gentoobrowse-api/service/maintenance/packageMetaProcessor.h @@ -14,9 +14,6 @@ namespace Gentoo { void created(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const; void modified(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const; void deleted(DB::Connection * dbc, const boost::filesystem::path & fn) const; - - private: - void update(DB::Connection * dbc, const boost::filesystem::path & fn, const boost::filesystem::path & path) const; }; } } -- cgit v1.2.3