@@ -957,7 +957,7 @@ dummy_func(
957
957
if (PyErr_GivenExceptionMatches (exc_value , PyExc_StopIteration )) {
958
958
value = Py_NewRef (((PyStopIterationObject * )exc_value )-> value );
959
959
DECREF_INPUTS ();
960
- none = Py_NewRef ( Py_None ) ;
960
+ none = Py_None ;
961
961
}
962
962
else {
963
963
_PyErr_SetRaisedException (tstate , Py_NewRef (exc_value ));
@@ -1911,7 +1911,6 @@ dummy_func(
1911
1911
_Py_DECREF_SPECIALIZED (left , _PyFloat_ExactDealloc );
1912
1912
_Py_DECREF_SPECIALIZED (right , _PyFloat_ExactDealloc );
1913
1913
res = (sign_ish & oparg ) ? Py_True : Py_False ;
1914
- Py_INCREF (res );
1915
1914
}
1916
1915
1917
1916
// Similar to COMPARE_OP_FLOAT
@@ -1930,7 +1929,6 @@ dummy_func(
1930
1929
_Py_DECREF_SPECIALIZED (left , (destructor )PyObject_Free );
1931
1930
_Py_DECREF_SPECIALIZED (right , (destructor )PyObject_Free );
1932
1931
res = (sign_ish & oparg ) ? Py_True : Py_False ;
1933
- Py_INCREF (res );
1934
1932
}
1935
1933
1936
1934
// Similar to COMPARE_OP_FLOAT, but for ==, != only
@@ -1946,20 +1944,19 @@ dummy_func(
1946
1944
assert ((oparg & 0xf ) == COMPARISON_NOT_EQUALS || (oparg & 0xf ) == COMPARISON_EQUALS );
1947
1945
assert (COMPARISON_NOT_EQUALS + 1 == COMPARISON_EQUALS );
1948
1946
res = ((COMPARISON_NOT_EQUALS + eq ) & oparg ) ? Py_True : Py_False ;
1949
- Py_INCREF (res );
1950
1947
}
1951
1948
1952
1949
inst (IS_OP , (left , right -- b )) {
1953
1950
int res = Py_Is (left , right ) ^ oparg ;
1954
1951
DECREF_INPUTS ();
1955
- b = Py_NewRef ( res ? Py_True : Py_False ) ;
1952
+ b = res ? Py_True : Py_False ;
1956
1953
}
1957
1954
1958
1955
inst (CONTAINS_OP , (left , right -- b )) {
1959
1956
int res = PySequence_Contains (right , left );
1960
1957
DECREF_INPUTS ();
1961
1958
ERROR_IF (res < 0 , error );
1962
- b = Py_NewRef (( res ^oparg ) ? Py_True : Py_False ) ;
1959
+ b = ( res ^oparg ) ? Py_True : Py_False ;
1963
1960
}
1964
1961
1965
1962
inst (CHECK_EG_MATCH , (exc_value , match_type -- rest , match )) {
@@ -1992,7 +1989,7 @@ dummy_func(
1992
1989
1993
1990
int res = PyErr_GivenExceptionMatches (left , right );
1994
1991
DECREF_INPUTS ();
1995
- b = Py_NewRef ( res ? Py_True : Py_False ) ;
1992
+ b = res ? Py_True : Py_False ;
1996
1993
}
1997
1994
1998
1995
inst (IMPORT_NAME , (level , fromlist -- res )) {
@@ -2106,19 +2103,19 @@ dummy_func(
2106
2103
}
2107
2104
else {
2108
2105
ERROR_IF (_PyErr_Occurred (tstate ), error ); // Error!
2109
- attrs = Py_NewRef ( Py_None ) ; // Failure!
2106
+ attrs = Py_None ; // Failure!
2110
2107
}
2111
2108
}
2112
2109
2113
2110
inst (MATCH_MAPPING , (subject -- subject , res )) {
2114
2111
int match = Py_TYPE (subject )-> tp_flags & Py_TPFLAGS_MAPPING ;
2115
- res = Py_NewRef ( match ? Py_True : Py_False ) ;
2112
+ res = match ? Py_True : Py_False ;
2116
2113
PREDICT (POP_JUMP_IF_FALSE );
2117
2114
}
2118
2115
2119
2116
inst (MATCH_SEQUENCE , (subject -- subject , res )) {
2120
2117
int match = Py_TYPE (subject )-> tp_flags & Py_TPFLAGS_SEQUENCE ;
2121
- res = Py_NewRef ( match ? Py_True : Py_False ) ;
2118
+ res = match ? Py_True : Py_False ;
2122
2119
PREDICT (POP_JUMP_IF_FALSE );
2123
2120
}
2124
2121
@@ -2309,7 +2306,7 @@ dummy_func(
2309
2306
STAT_INC (FOR_ITER , hit );
2310
2307
_PyInterpreterFrame * gen_frame = (_PyInterpreterFrame * )gen -> gi_iframe ;
2311
2308
frame -> return_offset = oparg ;
2312
- _PyFrame_StackPush (gen_frame , Py_NewRef ( Py_None ) );
2309
+ _PyFrame_StackPush (gen_frame , Py_None );
2313
2310
gen -> gi_frame_state = FRAME_EXECUTING ;
2314
2311
gen -> gi_exc_state .previous_item = tstate -> exc_info ;
2315
2312
tstate -> exc_info = & gen -> gi_exc_state ;
@@ -2416,7 +2413,7 @@ dummy_func(
2416
2413
prev_exc = exc_info -> exc_value ;
2417
2414
}
2418
2415
else {
2419
- prev_exc = Py_NewRef ( Py_None ) ;
2416
+ prev_exc = Py_None ;
2420
2417
}
2421
2418
assert (PyExceptionInstance_Check (new_exc ));
2422
2419
exc_info -> exc_value = Py_NewRef (new_exc );
0 commit comments