Skip to content

Commit 89db9d8

Browse files
author
Florian Wagner
committed
an actual improvmenet due to using std
1 parent 54fd45f commit 89db9d8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

source/glkernel/include/glkernel/sample.hpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,9 @@ void n_rooks(tkernel<glm::tvec2<T, P>> & kernel)
295295
std::uniform_real_distribution<> jitter_dist(0.0, stratum_size);
296296

297297
// create pool of column indices and shuffle it
298-
std::vector<int> columnIndices;
299-
for (int k = 0; k < static_cast<int>(kernel.size()); ++k)
300-
{
301-
columnIndices.push_back(k);
302-
}
298+
std::vector<int> columnIndices = std::vector<int>(kernel.size());
299+
std::iota(columnIndices.begin(), columnIndices.end(), 0);
300+
303301
std::random_shuffle(columnIndices.begin(), columnIndices.end());
304302

305303
// use columnIndices to shuffle samples in y-direction

0 commit comments

Comments
 (0)