From f88f4b52a467989b13f90523fca23697a722ced0 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Thu, 23 Feb 2023 09:10:18 +0800 Subject: [PATCH] remove index check --- src/tuplelist.h | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/tuplelist.h b/src/tuplelist.h index 76a811a3..725279b6 100644 --- a/src/tuplelist.h +++ b/src/tuplelist.h @@ -5,28 +5,7 @@ #include "str.h" namespace pkpy { - class List: public std::vector { - PyVar& at(size_t) = delete; - - inline void _check_index(size_t i) const { - if (i >= size()){ - auto msg = "std::vector index out of range, " + std::to_string(i) + " not in [0, " + std::to_string(size()) + ")"; - throw std::out_of_range(msg); - } - } - public: - PyVar& operator[](size_t i) { - _check_index(i); - return std::vector::operator[](i); - } - - const PyVar& operator[](size_t i) const { - _check_index(i); - return std::vector::operator[](i); - } - - using std::vector::vector; - }; + using List = std::vector; class Args { static THREAD_LOCAL SmallArrayPool _pool;