From 4bba7af2c2cc2c6e0a457e6b98c6fe3fb304d099 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 5 Sep 2019 21:52:40 -0400 Subject: [PATCH] DiscBase: std::move std::function instance std::function isn't a trivial type (it's allowed to heap allocate to store any necessary captures), so we can move it in the constructor to avoid any unnecessary allocations --- include/nod/DiscBase.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/nod/DiscBase.hpp b/include/nod/DiscBase.hpp index 4448217..87ac776 100644 --- a/include/nod/DiscBase.hpp +++ b/include/nod/DiscBase.hpp @@ -457,7 +457,7 @@ public: : m_outPath(outPath) , m_fileIO(NewFileIO(outPath, discCapacity)) , m_discCapacity(discCapacity) - , m_progressCB(progressCB) {} + , m_progressCB(std::move(progressCB)) {} DiscBuilderBase(DiscBuilderBase&&) = default; DiscBuilderBase& operator=(DiscBuilderBase&&) = default;