From f4f339e59e0d99e6dfd5787050b2fede11bac32f Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Sun, 25 Aug 2024 08:30:30 +0200 Subject: [PATCH] [pythonic/list] remove unused trait and make some constant private instead of global --- pythran/pythonic/include/types/list.hpp | 19 +------------------ pythran/pythonic/types/list.hpp | 2 +- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/pythran/pythonic/include/types/list.hpp b/pythran/pythonic/include/types/list.hpp index 0b921bd6a..be008c7bc 100644 --- a/pythran/pythonic/include/types/list.hpp +++ b/pythran/pythonic/include/types/list.hpp @@ -26,8 +26,6 @@ namespace types template using container = std::vector>; - static const size_t DEFAULT_LIST_CAPACITY = 16; - /* forward declaration */ struct empty_list; template @@ -38,22 +36,6 @@ namespace types struct ndarray; template struct pshape; - template - struct is_list { - static const bool value = false; - }; - template - struct is_list> { - static const bool value = true; - }; - template - struct is_list> { - static const bool value = true; - }; - template - struct is_list> { - static const bool value = true; - }; /* for type disambiguification */ struct single_value { @@ -193,6 +175,7 @@ namespace types template class list { + static constexpr size_t DEFAULT_CAPACITY = 16; // data holder typedef diff --git a/pythran/pythonic/types/list.hpp b/pythran/pythonic/types/list.hpp index 7f1de3c49..9c346b070 100644 --- a/pythran/pythonic/types/list.hpp +++ b/pythran/pythonic/types/list.hpp @@ -261,7 +261,7 @@ namespace types std::random_access_iterator_tag>::value) _data->reserve(std::distance(start, stop)); else - _data->reserve(DEFAULT_LIST_CAPACITY); + _data->reserve(DEFAULT_CAPACITY); std::copy(start, stop, std::back_inserter(*_data)); } template