From e47ff8131b0d3e038268e610d60902f08d750862 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 5 Sep 2021 20:46:46 -0700 Subject: [PATCH] Move `max` off of `textboxclass` This is a variable that's only used in one method, and it's always initialized beforehand. No need to carry it around, taking up memory, and making code analysis more complicated. --- desktop_version/src/Textbox.cpp | 3 +-- desktop_version/src/Textbox.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/desktop_version/src/Textbox.cpp b/desktop_version/src/Textbox.cpp index 3d829980..ba65e54c 100644 --- a/desktop_version/src/Textbox.cpp +++ b/desktop_version/src/Textbox.cpp @@ -20,7 +20,6 @@ textboxclass::textboxclass(void) tr = 0; tg = 0; tb = 0; - max = 0; flipme = false; @@ -111,7 +110,7 @@ void textboxclass::removefast(void) void textboxclass::resize(void) { //Set the width and height to the correct sizes - max = 0; + int max = 0; for (size_t iter = 0; iter < line.size(); iter++) { unsigned int len = utf8::unchecked::distance(line[iter].begin(), line[iter].end()); diff --git a/desktop_version/src/Textbox.h b/desktop_version/src/Textbox.h index 870d6acf..641b7f8b 100644 --- a/desktop_version/src/Textbox.h +++ b/desktop_version/src/Textbox.h @@ -41,8 +41,6 @@ public: float prev_tl; int tm; - int max; - /* Whether to flip text box y-position in Flip Mode. */ bool flipme;