From: Steinar H. Gunderson Date: Fri, 21 Dec 2018 23:08:10 +0000 (+0100) Subject: In Theme::get_chain(), send InputState by reference instead of value. X-Git-Tag: 1.8.1~47 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=aa6cef228bda3977763472d6bbc03b5a0302c866;hp=eea413eca702128135b2e6cc72ab6da5e175b633;p=nageru In Theme::get_chain(), send InputState by reference instead of value. It's ~2 kB, and we also don't have to fiddle as many refcounts around. It's only once per channel per frame, though. Found by Coverity Scan. --- diff --git a/nageru/theme.cpp b/nageru/theme.cpp index c926dd4..d28f5b2 100644 --- a/nageru/theme.cpp +++ b/nageru/theme.cpp @@ -1217,7 +1217,7 @@ void Theme::register_class(const char *class_name, const luaL_Reg *funcs) assert(lua_gettop(L) == 0); } -Theme::Chain Theme::get_chain(unsigned num, float t, unsigned width, unsigned height, InputState input_state) +Theme::Chain Theme::get_chain(unsigned num, float t, unsigned width, unsigned height, const InputState &input_state) { Chain chain; diff --git a/nageru/theme.h b/nageru/theme.h index 0a23995..3d57750 100644 --- a/nageru/theme.h +++ b/nageru/theme.h @@ -41,7 +41,7 @@ public: std::vector input_frames; }; - Chain get_chain(unsigned num, float t, unsigned width, unsigned height, InputState input_state); + Chain get_chain(unsigned num, float t, unsigned width, unsigned height, const InputState &input_state); int get_num_channels() const { return num_channels; } int map_signal(int signal_num);