diff options
author | 12xx12 <44411062+12xx12@users.noreply.github.com> | 2021-03-07 17:31:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-07 17:31:43 +0100 |
commit | 3daf253b7f4ed8243e3262faee35219335e3e088 (patch) | |
tree | 72d7c719838d23c979fdc57f1d6053bab38d8275 /src/ProbabDistrib.cpp | |
parent | Mitigate MSVC crash (#5146) (diff) | |
download | cuberite-3daf253b7f4ed8243e3262faee35219335e3e088.tar cuberite-3daf253b7f4ed8243e3262faee35219335e3e088.tar.gz cuberite-3daf253b7f4ed8243e3262faee35219335e3e088.tar.bz2 cuberite-3daf253b7f4ed8243e3262faee35219335e3e088.tar.lz cuberite-3daf253b7f4ed8243e3262faee35219335e3e088.tar.xz cuberite-3daf253b7f4ed8243e3262faee35219335e3e088.tar.zst cuberite-3daf253b7f4ed8243e3262faee35219335e3e088.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ProbabDistrib.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ProbabDistrib.cpp b/src/ProbabDistrib.cpp index b074bf058..07981d031 100644 --- a/src/ProbabDistrib.cpp +++ b/src/ProbabDistrib.cpp @@ -31,7 +31,7 @@ void cProbabDistrib::SetPoints(const cProbabDistrib::cPoints & a_Points) int LastValue = -1; if (a_Points[0].m_Value != 0) { - m_Cumulative.push_back(cPoint(0, 0)); // Always push in the [0, 0] point for easier search algorithm bounds + m_Cumulative.emplace_back(0, 0); // Always push in the [0, 0] point for easier search algorithm bounds LastValue = 0; } for (cPoints::const_iterator itr = a_Points.begin(), end = a_Points.end(); itr != end; ++itr) @@ -45,11 +45,11 @@ void cProbabDistrib::SetPoints(const cProbabDistrib::cPoints & a_Points) ProbSum += (LastProb + itr->m_Probability) * (itr->m_Value - LastValue) / 2; LastProb = itr->m_Probability; LastValue = itr->m_Value; - m_Cumulative.push_back(cPoint(itr->m_Value, ProbSum)); + m_Cumulative.emplace_back(itr->m_Value, ProbSum); } // for itr - a_Points[] if (LastValue != m_MaxValue) { - m_Cumulative.push_back(cPoint(m_MaxValue, 0)); // Always push in the last point for easier search algorithm bounds + m_Cumulative.emplace_back(m_MaxValue, 0); // Always push in the last point for easier search algorithm bounds } m_Sum = ProbSum; } @@ -84,7 +84,7 @@ bool cProbabDistrib::SetDefString(const AString & a_DefString) // Number parse error return false; } - Pts.push_back(cPoint(Value, Prob)); + Pts.emplace_back(Value, Prob); } // for itr - Points[] SetPoints(Pts); |