# HG changeset patch # User Sebastien Jodogne # Date 1445013293 -7200 # Node ID c3baf74e443f7b45aa4069d25c3a3134d07ff653 # Parent 81d718bba59905fde9ebb95ade7c29d051cc7048 simplify diff -r 81d718bba599 -r c3baf74e443f OrthancServer/DatabaseWrapperBase.cpp --- a/OrthancServer/DatabaseWrapperBase.cpp Fri Oct 16 18:19:28 2015 +0200 +++ b/OrthancServer/DatabaseWrapperBase.cpp Fri Oct 16 18:34:53 2015 +0200 @@ -312,11 +312,11 @@ } - static void SetMainDicomTagsInternal(SQLite::Statement& s, - int64_t id, - const DicomTag& tag, - const std::string& value) + void DatabaseWrapperBase::SetMainDicomTag(int64_t id, + const DicomTag& tag, + const std::string& value) { + SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO MainDicomTags VALUES(?, ?, ?, ?)"); s.BindInt64(0, id); s.BindInt(1, tag.GetGroup()); s.BindInt(2, tag.GetElement()); @@ -325,21 +325,16 @@ } - void DatabaseWrapperBase::SetMainDicomTag(int64_t id, - const DicomTag& tag, - const std::string& value) - { - SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO MainDicomTags VALUES(?, ?, ?, ?)"); - SetMainDicomTagsInternal(s, id, tag, value); - } - - void DatabaseWrapperBase::SetIdentifierTag(int64_t id, const DicomTag& tag, const std::string& value) { SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO DicomIdentifiers VALUES(?, ?, ?, ?)"); - SetMainDicomTagsInternal(s, id, tag, value); + s.BindInt64(0, id); + s.BindInt(1, tag.GetGroup()); + s.BindInt(2, tag.GetElement()); + s.BindString(3, value); + s.Run(); }