| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Replace "Py_DECREF(var); var = NULL;" with "Py_SETREF(var, NULL);".
|
@erlend-aasland: I wrote PR #99686 to replace Py_XDECREF(var); var=NULL; with Py_CLEAR(var);. This PR is to replace Py_DECREF(var); var=NULL; with Py_SETREF(var, NULL);. What do you think? Does it make the code shorter and more readable? For me, Py_SETREF() is easier because I don't have to think: hum, should DECREF be called before or after setting the variable to the new value (NULL)? From my point of view, it looks like an "atomic" which is always "correct" (when used properly: when the variable already contains a strong reference). |
Sorry, something went wrong.
Sorry, I forgot about this! IMO, this change improves readability. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Replace "Py_DECREF(var); var = NULL;" with "Py_SETREF(var, NULL);".