Remove unnecessary NULL check

This commit is contained in:
Kovid Goyal 2019-02-23 07:42:08 +05:30
parent ca38568187
commit aed504efdc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -205,7 +205,7 @@ match(PyObject *self, PyObject *args) {
size_t num_lines = PyList_GET_SIZE(lines);
char **clines = malloc(sizeof(char*) * num_lines);
size_t *sizes = malloc(sizeof(size_t) * num_lines);
if (!lines || !sizes) { return PyErr_NoMemory(); }
if (!sizes) { return PyErr_NoMemory(); }
for (size_t i = 0; i < num_lines; i++) {
clines[i] = PyBytes_AS_STRING(PyList_GET_ITEM(lines, i));
sizes[i] = PyBytes_GET_SIZE(PyList_GET_ITEM(lines, i));