This commit is contained in:
blueloveTH 2024-06-01 21:54:39 +08:00
parent bd364d9967
commit 766bf5fa34
3 changed files with 6 additions and 9 deletions

View File

@ -21,7 +21,6 @@ struct Tuple {
Tuple(PyVar, PyVar); Tuple(PyVar, PyVar);
Tuple(PyVar, PyVar, PyVar); Tuple(PyVar, PyVar, PyVar);
Tuple(PyVar, PyVar, PyVar, PyVar);
bool is_inlined() const { return _args == _inlined; } bool is_inlined() const { return _args == _inlined; }
PyVar& operator[](int i){ return _args[i]; } PyVar& operator[](int i){ return _args[i]; }

View File

@ -350,7 +350,12 @@ struct Array2d{
int width = right - left + 1; int width = right - left + 1;
int height = bottom - top + 1; int height = bottom - top + 1;
if(width <= 0 || height <= 0) return vm->None; 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));
}); });
} }

View File

@ -38,13 +38,6 @@ Tuple::Tuple(PyVar _0, PyVar _1, PyVar _2): Tuple(3){
_args[2] = _2; _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); } Tuple::~Tuple(){ if(!is_inlined()) free(_args); }
List ArgsView::to_list() const{ List ArgsView::to_list() const{