blueloveTH 1 year ago
parent
commit
766bf5fa34
3 changed files with 6 additions and 9 deletions
  1. 0 1
      include/pocketpy/tuplelist.h
  2. 6 1
      src/array2d.cpp
  3. 0 7
      src/tuplelist.cpp

+ 0 - 1
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]; }

+ 6 - 1
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));
         });
     }
 

+ 0 - 7
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{