Don't copy data needlessly

This commit is contained in:
Roland Kaufmann 2013-11-22 10:35:55 +01:00
parent f83d581e42
commit f45f7d19a0

View File

@ -171,7 +171,7 @@ private:
/// Helper function that is the meat of the constructor
template <typename U>
void copyData (std::vector <U> data,
void copyData (const std::vector <U>& data,
const int offset,
const int stride) {
// number of elements to take
@ -186,7 +186,7 @@ private:
// Compute the number of outputs this dataset will give
template <typename U>
int dataSize (std::vector <U> data,
int dataSize (const std::vector <U>& data,
const int offset,
const int stride) {
// number of elements we can possibly take from the vector