summaryrefslogtreecommitdiffstats
path: root/src/ProbabDistrib.cpp
diff options
context:
space:
mode:
author12xx12 <44411062+12xx12@users.noreply.github.com>2021-03-07 17:31:43 +0100
committerGitHub <noreply@github.com>2021-03-07 17:31:43 +0100
commit3daf253b7f4ed8243e3262faee35219335e3e088 (patch)
tree72d7c719838d23c979fdc57f1d6053bab38d8275 /src/ProbabDistrib.cpp
parentMitigate MSVC crash (#5146) (diff)
downloadcuberite-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 'src/ProbabDistrib.cpp')
-rw-r--r--src/ProbabDistrib.cpp8
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);