@@ -471,10 +471,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy *
471471 continue ;
472472 }
473473
474- Py_XINCREF (leftItem);
474+ Py_INCREF (leftItem);
475475 Py_INCREF (rightItem);
476476 int k = PyObject_RichCompareBool (leftItem, rightItem, Py_EQ);
477- Py_XDECREF (leftItem);
477+ Py_DECREF (leftItem);
478478 Py_DECREF (rightItem);
479479 if (k < 0 ) {
480480 return NULL ;
@@ -483,7 +483,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy *
483483 break ;
484484 }
485485
486- Py_XDECREF (leftItem);
486+ Py_DECREF (leftItem);
487487 if (needToDecRefRightItem) {
488488 Py_DECREF (rightItem);
489489 }
@@ -506,7 +506,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_richcompare(JSArrayProxy *
506506 /* Compare the final item again using the proper operator */
507507 PyObject *pyElementVal = pyTypeFactory (GLOBAL_CX, elementVal);
508508 PyObject *result = PyObject_RichCompare (pyElementVal, ((PyListObject *)other)->ob_item [index], op);
509- Py_XDECREF (pyElementVal);
509+ Py_DECREF (pyElementVal);
510510 return result;
511511}
512512
@@ -551,7 +551,7 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_repr(JSArrayProxy *self) {
551551 } else {
552552 PyObject *pyElementVal = pyTypeFactory (GLOBAL_CX, elementVal);
553553 s = PyObject_Repr (pyElementVal);
554- Py_XDECREF (pyElementVal);
554+ Py_DECREF (pyElementVal);
555555 }
556556 if (s == NULL ) {
557557 goto error;
@@ -696,10 +696,10 @@ int JSArrayProxyMethodDefinitions::JSArrayProxy_contains(JSArrayProxy *self, PyO
696696 for (index = 0 , cmp = 0 ; cmp == 0 && index < numElements; ++index) {
697697 JS_GetElement (GLOBAL_CX, *(self->jsArray ), index, &elementVal);
698698 PyObject *item = pyTypeFactory (GLOBAL_CX, elementVal);
699- Py_XINCREF (item);
699+ Py_INCREF (item);
700700 cmp = PyObject_RichCompareBool (item, element, Py_EQ);
701- Py_XDECREF (item);
702- Py_XDECREF (item);
701+ Py_DECREF (item);
702+ Py_DECREF (item);
703703 }
704704 return cmp;
705705}
@@ -958,10 +958,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_remove(JSArrayProxy *self,
958958 for (Py_ssize_t index = 0 ; index < selfSize; index++) {
959959 JS_GetElement (GLOBAL_CX, *(self->jsArray ), index, &elementVal);
960960 PyObject *obj = pyTypeFactory (GLOBAL_CX, elementVal);
961- Py_XINCREF (obj);
961+ Py_INCREF (obj);
962962 int cmp = PyObject_RichCompareBool (obj, value, Py_EQ);
963- Py_XDECREF (obj);
964- Py_XDECREF (obj);
963+ Py_DECREF (obj);
964+ Py_DECREF (obj);
965965 if (cmp > 0 ) {
966966 JS::Rooted<JS::ValueArray<2 >> jArgs (GLOBAL_CX);
967967 jArgs[0 ].setInt32 (index);
@@ -1024,10 +1024,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_index(JSArrayProxy *self,
10241024 for (Py_ssize_t index = start; index < stop && index < selfSize; index++) {
10251025 JS_GetElement (GLOBAL_CX, *(self->jsArray ), index, &elementVal);
10261026 PyObject *obj = pyTypeFactory (GLOBAL_CX, elementVal);
1027- Py_XINCREF (obj);
1027+ Py_INCREF (obj);
10281028 int cmp = PyObject_RichCompareBool (obj, value, Py_EQ);
1029- Py_XDECREF (obj);
1030- Py_XDECREF (obj);
1029+ Py_DECREF (obj);
1030+ Py_DECREF (obj);
10311031 if (cmp > 0 ) {
10321032 return PyLong_FromSsize_t (index);
10331033 }
@@ -1048,10 +1048,10 @@ PyObject *JSArrayProxyMethodDefinitions::JSArrayProxy_count(JSArrayProxy *self,
10481048 for (Py_ssize_t index = 0 ; index < length; index++) {
10491049 JS_GetElement (GLOBAL_CX, *(self->jsArray ), index, &elementVal);
10501050 PyObject *obj = pyTypeFactory (GLOBAL_CX, elementVal);
1051- Py_XINCREF (obj);
1051+ Py_INCREF (obj);
10521052 int cmp = PyObject_RichCompareBool (obj, value, Py_EQ);
1053- Py_XDECREF (obj);
1054- Py_XDECREF (obj);
1053+ Py_DECREF (obj);
1054+ Py_DECREF (obj);
10551055 if (cmp > 0 ) {
10561056 count++;
10571057 }
@@ -1097,15 +1097,15 @@ static bool sort_compare_key_func(JSContext *cx, unsigned argc, JS::Value *vp) {
10971097 JS::RootedValue elementVal0 (cx, args[0 ]);
10981098 PyObject *args_0 = pyTypeFactory (cx, elementVal0);
10991099 PyObject *args_0_result = PyObject_CallFunction (keyfunc, " O" , args_0);
1100- Py_XDECREF (args_0);
1100+ Py_DECREF (args_0);
11011101 if (!args_0_result) {
11021102 return false ;
11031103 }
11041104
11051105 JS::RootedValue elementVal1 (cx, args[1 ]);
11061106 PyObject *args_1 = pyTypeFactory (cx, elementVal1);
11071107 PyObject *args_1_result = PyObject_CallFunction (keyfunc, " O" , args_1);
1108- Py_XDECREF (args_1);
1108+ Py_DECREF (args_1);
11091109 if (!args_1_result) {
11101110 return false ;
11111111 }
@@ -1163,19 +1163,19 @@ static bool sort_compare_default(JSContext *cx, unsigned argc, JS::Value *vp) {
11631163 args.rval ().setInt32 (reverse ? -1 : 1 );
11641164 }
11651165 else {
1166- Py_XDECREF (args_0);
1167- Py_XDECREF (args_1);
1166+ Py_DECREF (args_0);
1167+ Py_DECREF (args_1);
11681168 return false ;
11691169 }
11701170 }
11711171 else {
1172- Py_XDECREF (args_0);
1173- Py_XDECREF (args_1);
1172+ Py_DECREF (args_0);
1173+ Py_DECREF (args_1);
11741174 return false ;
11751175 }
11761176
1177- Py_XDECREF (args_0);
1178- Py_XDECREF (args_1);
1177+ Py_DECREF (args_0);
1178+ Py_DECREF (args_1);
11791179 return true ;
11801180}
11811181
0 commit comments