From 766bf5fa347804d27bbcb8b4cdf7bd61f6cf3f0e Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sat, 1 Jun 2024 21:54:39 +0800 Subject: [PATCH] some fix --- include/pocketpy/tuplelist.h | 1 - src/array2d.cpp | 7 ++++++- src/tuplelist.cpp | 7 ------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/pocketpy/tuplelist.h b/include/pocketpy/tuplelist.h index fa6ff66c..43479678 100644 --- a/include/pocketpy/tuplelist.h +++ b/include/pocketpy/tuplelist.h @@ -21,7 +21,6 @@ struct Tuple { Tuple(PyVar, PyVar); Tuple(PyVar, PyVar, PyVar); - Tuple(PyVar, PyVar, PyVar, PyVar); bool is_inlined() const { return _args == _inlined; } PyVar& operator[](int i){ return _args[i]; } diff --git a/src/array2d.cpp b/src/array2d.cpp index adb2f437..bdf30cc6 100644 --- a/src/array2d.cpp +++ b/src/array2d.cpp @@ -350,7 +350,12 @@ struct Array2d{ int width = right - left + 1; int height = bottom - top + 1; if(width <= 0 || height <= 0) return vm->None; - return VAR(Tuple(VAR(left), VAR(top), VAR(width), VAR(height))); + Tuple t(4); + t[0] = VAR(left); + t[1] = VAR(top); + t[2] = VAR(width); + t[3] = VAR(height); + return VAR(std::move(t)); }); } diff --git a/src/tuplelist.cpp b/src/tuplelist.cpp index 2f8b6c4f..6c86c7a1 100644 --- a/src/tuplelist.cpp +++ b/src/tuplelist.cpp @@ -38,13 +38,6 @@ Tuple::Tuple(PyVar _0, PyVar _1, PyVar _2): Tuple(3){ _args[2] = _2; } -Tuple::Tuple(PyVar _0, PyVar _1, PyVar _2, PyVar _3): Tuple(4){ - _args[0] = _0; - _args[1] = _1; - _args[2] = _2; - _args[3] = _3; -} - Tuple::~Tuple(){ if(!is_inlined()) free(_args); } List ArgsView::to_list() const{