Skip to content
Snippets Groups Projects
Commit c0aefa7e authored by Yoel's avatar Yoel
Browse files

Changed some parameters to const-refs

parent 69a21f0d
No related branches found
No related tags found
No related merge requests found
......@@ -18,10 +18,10 @@ Threadpool::~Threadpool() {
alive = false;
cv.notify_all();
for (auto &thread : threads) thread.join();
for (auto& thread : threads) thread.join();
}
void Threadpool::queueTask(std::function<void(void)> task) {
void Threadpool::queueTask(const std::function<void(void)>& task) {
std::unique_lock<std::mutex> lock(m);
q.emplace(task);
lock.unlock();
......
......@@ -13,7 +13,7 @@ class Threadpool {
Threadpool(size_t n);
~Threadpool();
// Add a task to the queue
void queueTask(std::function<void(void)> task);
void queueTask(const std::function<void(void)>& task);
private:
void threading();
......
#include "Transformation.h"
namespace util {
util::Transformation::Transformation(Mat4 matrix)
util::Transformation::Transformation(const Mat4& matrix)
: toWorld(matrix),
fromWorld(matrix.invertFull()),
toWorldN(matrix.invertFull().transpose()) {
......
......@@ -4,7 +4,7 @@
namespace util {
class Transformation {
public:
Transformation(Mat4 matrix);
Transformation(const Mat4& matrix);
const Mat4 toWorld, fromWorld, toWorldN;
};
} // namespace util
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment