Skip to content

Commit

Permalink
fix operators in JobStat
Browse files Browse the repository at this point in the history
This comes from 759f2d0, which
despite its name actually did some code changes and get this one
wrong.
  • Loading branch information
llunak committed Apr 13, 2020
1 parent 12ae41c commit 36810a2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scheduler/jobstat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void JobStat::setJobId(unsigned int id)
m_jobId = id;
}

JobStat &JobStat::operator+(const JobStat &st)
JobStat &JobStat::operator+=(const JobStat &st)
{
m_outputSize += st.m_outputSize;
m_compileTimeReal += st.m_compileTimeReal;
Expand All @@ -92,12 +92,13 @@ JobStat &JobStat::operator+(const JobStat &st)
return *this;
}

JobStat &JobStat::operator+=(const JobStat &st)
JobStat &JobStat::operator+(const JobStat &st)
{
return *this + st;
JobStat r = *this;
return r += st;
}

JobStat &JobStat::operator-(const JobStat &st)
JobStat &JobStat::operator-=(const JobStat &st)
{
m_outputSize -= st.m_outputSize;
m_compileTimeReal -= st.m_compileTimeReal;
Expand All @@ -107,9 +108,10 @@ JobStat &JobStat::operator-(const JobStat &st)
return *this;
}

JobStat &JobStat::operator-=(const JobStat &st)
JobStat &JobStat::operator-(const JobStat &st)
{
return *this - st;
JobStat r = *this;
return r -= st;
}

JobStat JobStat::operator/(int d) const
Expand Down

0 comments on commit 36810a2

Please sign in to comment.