From 11a58ca2c92fc3c44daa1643fbc5148bf96b407c Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Tue, 12 Apr 2016 23:35:46 -0300 Subject: BarChart, Scatterplot, VoronoiSplat: removed unnecessary resize()s. --- barchart.cpp | 3 +-- scatterplot.cpp | 3 +-- 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); } -- cgit v1.2.3