I should be using + instead of += apparently.

Yay for ##c++ for pointing this out.
This commit is contained in:
Jason Felds
2013-04-30 20:36:04 -04:00
parent f265465096
commit 3171f15df2
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ static void SplitWithQuotes( const RString sSource, const char Delimitor, vector
RString Commands::GetOriginalCommandString() const
{
return std::accumulate(v.begin(), v.end(), RString(), [](RString &res, Command const &c) { return res += c.GetOriginalCommandString(); });
return std::accumulate(v.begin(), v.end(), RString(), [](RString &res, Command const &c) { return res + c.GetOriginalCommandString(); });
}
void ParseCommands( const RString &sCommands, Commands &vCommandsOut )
+1 -1
View File
@@ -150,7 +150,7 @@ void AnimatedTexture::SetState( int iState )
float AnimatedTexture::GetAnimationLengthSeconds() const
{
return std::accumulate(vFrames.begin(), vFrames.end(), 0.f,
[](float total, AnimatedTextureState const &state) { return total += state.fDelaySecs; });
[](float total, AnimatedTextureState const &state) { return total + state.fDelaySecs; });
}
void AnimatedTexture::SetSecondsIntoAnimation( float fSeconds )
+1 -1
View File
@@ -315,7 +315,7 @@ int PlayerStageStats::GetLessonScoreActual() const
int PlayerStageStats::GetLessonScoreNeeded() const
{
float score = std::accumulate(m_vpPossibleSteps.begin(), m_vpPossibleSteps.end(), 0.f,
[](float total, Steps const *steps) { return total += steps->GetRadarValues(PLAYER_1).m_Values.v.fNumTapsAndHolds; });
[](float total, Steps const *steps) { return total + steps->GetRadarValues(PLAYER_1).m_Values.v.fNumTapsAndHolds; });
return lrintf( score * LESSON_PASS_THRESHOLD );
}
+1 -1
View File
@@ -743,7 +743,7 @@ void Sprite::SetState( int iNewState )
float Sprite::GetAnimationLengthSeconds() const
{
return std::accumulate(m_States.begin(), m_States.end(), 0.f, [](float total, State const &s) { return total += s.fDelay; });
return std::accumulate(m_States.begin(), m_States.end(), 0.f, [](float total, State const &s) { return total + s.fDelay; });
}
void Sprite::SetSecondsIntoAnimation( float fSeconds )
+2 -2
View File
@@ -159,14 +159,14 @@ int Trail::GetMeter() const
int Trail::GetTotalMeter() const
{
return std::accumulate(m_vEntries.begin(), m_vEntries.end(), 0, [](int total, TrailEntry const &e) {
return total += e.pSteps->GetMeter();
return total + e.pSteps->GetMeter();
});
}
float Trail::GetLengthSeconds() const
{
return std::accumulate(m_vEntries.begin(), m_vEntries.end(), 0.f, [](float total, TrailEntry const &e) {
return total += e.pSong->m_fMusicLengthSeconds;
return total + e.pSong->m_fMusicLengthSeconds;
});
}
+1 -1
View File
@@ -15,7 +15,7 @@ int TrailUtil::GetNumSongs( const Trail *pTrail )
float TrailUtil::GetTotalSeconds( const Trail *pTrail )
{
auto const &entries = pTrail->m_vEntries;
return std::accumulate(entries.begin(), entries.end(), 0.f, [](float total, TrailEntry const &e) { return total += e.pSong->m_fMusicLengthSeconds; });
return std::accumulate(entries.begin(), entries.end(), 0.f, [](float total, TrailEntry const &e) { return total + e.pSong->m_fMusicLengthSeconds; });
}
///////////////////////////////////////////////////////////////////////