Skip to content

Commit

Permalink
refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
itzpr3d4t0r committed Jun 22, 2023
1 parent cb20387 commit d1ca70b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src_c/circle.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ pgCircle_FromObject(PyObject *obj, pgCircleBase *out)
length = PySequence_Fast_GET_SIZE(obj);

if (length == 3) {
if (!pg_DoubleFromObj(f_arr[0], &(out->x)) ||
!pg_DoubleFromObj(f_arr[1], &(out->y)) ||
if (!pg_DoubleFromObj(f_arr[0], &out->x) ||
!pg_DoubleFromObj(f_arr[1], &out->y) ||
!_pg_circle_set_radius(f_arr[2], out)) {
return 0;
}
Expand All @@ -53,7 +53,7 @@ pgCircle_FromObject(PyObject *obj, pgCircleBase *out)
return 1;
}
else if (length == 2) {
if (!pg_TwoDoublesFromObj(f_arr[0], &(out->x), &(out->y)) ||
if (!pg_TwoDoublesFromObj(f_arr[0], &out->x, &out->y) ||
!_pg_circle_set_radius(f_arr[1], out)) {
return 0;
}
Expand All @@ -73,14 +73,14 @@ pgCircle_FromObject(PyObject *obj, pgCircleBase *out)
/*These are to be substituted with better pg_DoubleFromSeqIndex()
* implementations*/
tmp = PySequence_ITEM(obj, 0);
if (!pg_DoubleFromObj(tmp, &(out->x))) {
if (!pg_DoubleFromObj(tmp, &out->x)) {
Py_DECREF(tmp);
return 0;
}
Py_DECREF(tmp);

tmp = PySequence_ITEM(obj, 1);
if (!pg_DoubleFromObj(tmp, &(out->y))) {
if (!pg_DoubleFromObj(tmp, &out->y)) {
Py_DECREF(tmp);
return 0;
}
Expand All @@ -97,7 +97,7 @@ pgCircle_FromObject(PyObject *obj, pgCircleBase *out)
}
else if (length == 2) {
tmp = PySequence_ITEM(obj, 0);
if (!pg_TwoDoublesFromObj(tmp, &(out->x), &(out->y))) {
if (!pg_TwoDoublesFromObj(tmp, &out->x, &out->y)) {
Py_DECREF(tmp);
return 0;
}
Expand Down

0 comments on commit d1ca70b

Please sign in to comment.