Skip to content

Commit

Permalink
Move unique_ptr instead of releasing and acquiring it
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener authored and jmcarcell committed May 12, 2024
1 parent 72cf930 commit 3d19f2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/podio/Reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Reader {

template <typename T>
struct ReaderModel final : public ReaderConcept {
ReaderModel(T* reader) : m_reader(reader) {
ReaderModel(std::unique_ptr<T> reader) : m_reader(std::move(reader)) {
}
ReaderModel(const ReaderModel&) = delete;
ReaderModel& operator=(const ReaderModel&) = delete;
Expand Down
2 changes: 1 addition & 1 deletion src/Reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace podio {

template <typename T>
Reader::Reader(std::unique_ptr<T> reader) : m_self(std::make_unique<ReaderModel<T>>(reader.release())) {
Reader::Reader(std::unique_ptr<T> reader) : m_self(std::make_unique<ReaderModel<T>>(std::move(reader))) {
}

Reader makeReader(const std::string& filename) {
Expand Down

0 comments on commit 3d19f2e

Please sign in to comment.