Skip to content

Commit

Permalink
Fixed Interval copy constructor. Addresses #344.
Browse files Browse the repository at this point in the history
  • Loading branch information
hmatuschek committed Jun 19, 2023
1 parent e814420 commit aa828d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
13 changes: 0 additions & 13 deletions lib/interval.cc
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
#include "interval.hh"
#include <QRegularExpression>

Interval::Interval()
: _duration(0)
{
// pass...
}


Interval::Interval(const Interval &other)
: _duration(other._duration)
{
// pass...
}

QString
Interval::format(Format f) const {
if (0 == _duration)
Expand Down
13 changes: 11 additions & 2 deletions lib/interval.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,18 @@ protected:

public:
/** Default constructor. */
Interval();
Interval()
: _duration(0)
{
// pass...
}

/** Copy constructor. */
Interval(const Interval &other);
constexpr Interval(const Interval &other)
: _duration(other._duration)
{
// pass...
}

inline Interval &operator =(const Interval &other) { ///< Assignment.
_duration = other._duration; return *this;
Expand Down

0 comments on commit aa828d9

Please sign in to comment.