diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2016-04-12 23:35:46 -0300 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2016-04-12 23:35:46 -0300 |
commit | 11a58ca2c92fc3c44daa1643fbc5148bf96b407c (patch) | |
tree | bc019f02f1ee93f0788b16f422181e55761a597a | |
parent | 7d2b578c068d4e78250884c576c892b0a609d789 (diff) |
BarChart, Scatterplot, VoronoiSplat: removed unnecessary resize()s.
-rw-r--r-- | barchart.cpp | 3 | ||||
-rw-r--r-- | scatterplot.cpp | 3 | ||||
-rw-r--r-- | voronoisplat.cpp | 1 |
3 files changed, 2 insertions, 5 deletions
diff --git a/barchart.cpp b/barchart.cpp index ba68843..8eab073 100644 --- a/barchart.cpp +++ b/barchart.cpp @@ -52,8 +52,7 @@ void BarChart::setValues(const arma::vec &values) m_values = values; if (m_selection.size() != m_values.n_elem) { - m_selection.resize(m_values.n_elem); - m_selection.assign(m_selection.size(), false); + m_selection.assign(m_values.n_elem, false); } m_originalIndices.resize(m_values.n_elem); diff --git a/scatterplot.cpp b/scatterplot.cpp index 021456b..460e738 100644 --- a/scatterplot.cpp +++ b/scatterplot.cpp @@ -111,8 +111,7 @@ void Scatterplot::setXY(const arma::mat &xy) updateQuadTree(); if (m_selection.size() != m_xy.n_rows) { - m_selection.resize(m_xy.n_rows); - m_selection.assign(m_selection.size(), false); + m_selection.assign(m_xy.n_rows, false); } if (m_opacityData.n_elem != m_xy.n_rows) { diff --git a/voronoisplat.cpp b/voronoisplat.cpp index 15bb9bd..3e21e67 100644 --- a/voronoisplat.cpp +++ b/voronoisplat.cpp @@ -48,7 +48,6 @@ void VoronoiSplat::setSites(const arma::mat &points) if (m_values.size() > 0 && m_values.size() != points.n_rows) { // Old values are no longer valid, clean up - m_values.resize(points.n_rows); m_values.assign(points.n_rows, 0); } |