mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-12-31 13:49:11 +03:00
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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user