Skip to content

Commit

Permalink
[pythonic/list] remove unused trait and make some constant private in…
Browse files Browse the repository at this point in the history
…stead of global
  • Loading branch information
serge-sans-paille committed Aug 25, 2024
1 parent c8390d5 commit f4f339e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
19 changes: 1 addition & 18 deletions pythran/pythonic/include/types/list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ namespace types
template <class T>
using container = std::vector<T, utils::allocator<T>>;

static const size_t DEFAULT_LIST_CAPACITY = 16;

/* forward declaration */
struct empty_list;
template <class T>
Expand All @@ -38,22 +36,6 @@ namespace types
struct ndarray;
template <class... Tys>
struct pshape;
template <class T>
struct is_list {
static const bool value = false;
};
template <class T>
struct is_list<list<T>> {
static const bool value = true;
};
template <class T, class S>
struct is_list<sliced_list<T, S>> {
static const bool value = true;
};
template <class T, size_t N>
struct is_list<static_list<T, N>> {
static const bool value = true;
};

/* for type disambiguification */
struct single_value {
Expand Down Expand Up @@ -193,6 +175,7 @@ namespace types
template <class T>
class list
{
static constexpr size_t DEFAULT_CAPACITY = 16;

// data holder
typedef
Expand Down
2 changes: 1 addition & 1 deletion pythran/pythonic/types/list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class T>
Expand Down

0 comments on commit f4f339e

Please sign in to comment.