Simplify and reduce code duplication in Transaction constructors

- Leverage delegating constructor to avoid code duplication between the
  two available Transaction constructors.
  - The constructor without 'id' argument delegates to the one that
    receives it by providing `nullptr` as a value, which is used to
    flag that an id needs to be generated.
- Simplified constructor by removing member initialization where the
  default constructor will be invoked.
This commit is contained in:
Eduardo Arias
2024-09-03 17:43:48 -03:00
parent 2c613fb77c
commit 6ecfee7ab7
4 changed files with 34 additions and 123 deletions

View File

@@ -49,7 +49,7 @@ Parallel::~Parallel() {
}
inline std::string Parallel::logFilePath(time_t *t,
inline std::string Parallel::logFilePath(const time_t *t,
int part) {
std::string name;

View File

@@ -65,7 +65,7 @@ class Parallel : public Writer {
YearMonthDayAndTimeFileName = 8,
};
static inline std::string logFilePath(time_t *t, int part);
static inline std::string logFilePath(const time_t *t, int part);
};
} // namespace writer