From 471cf8587b31632e5886751432b6c246706738e6 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Sat, 4 Apr 2020 21:19:22 -0400 Subject: [PATCH] Mark constants in List constexpr so they don't actually take up space in created objects This resizes List from 24 bytes to 16 bytes. --- src/List.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/List.h b/src/List.h index 58624c7f0b..d4b9798e4d 100644 --- a/src/List.h +++ b/src/List.h @@ -33,8 +33,8 @@ template class List { public: - const int DEFAULT_LIST_SIZE = 10; - const int LIST_GROWTH_FACTOR = 2; + constexpr static int DEFAULT_LIST_SIZE = 10; + constexpr static int LIST_GROWTH_FACTOR = 2; ~List() { free(entries); } explicit List(int size = 0)