We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 628a77f commit 6f3b708Copy full SHA for 6f3b708
1 file changed
src/decode.rs
@@ -83,6 +83,7 @@ impl<'de, 'a> Visitor<'de> for JsonValue {
83
}
84
85
fn visit_unit<E>(self) -> Result<Self::Value, E> {
86
+ unsafe { pyo3::ffi::Py_INCREF(typeref::NONE) };
87
Ok(unsafe { typeref::NONE })
88
89
@@ -179,9 +180,7 @@ impl<'de, 'a> Visitor<'de> for JsonValue {
179
180
// counter Py_INCREF in insertdict
181
unsafe {
182
pyo3::ffi::Py_DECREF(pykey);
- if std::intrinsics::likely(value != typeref::NONE) {
183
- pyo3::ffi::Py_DECREF(value)
184
- }
+ pyo3::ffi::Py_DECREF(value);
185
};
186
187
Ok(dict_ptr)
0 commit comments