8000 Remove unnecessary if/else clause. · matplotlib/matplotlib@8b0e15c · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 8b0e15c

Browse files
committed
Remove unnecessary if/else clause.
1 parent 6c51794 commit 8b0e15c

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/_path_wrapper.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,6 @@ static PyObject *Py_convert_to_string(PyObject *self, PyObject *args, PyObject *
684684
char *codes[5];
685685
bool postfix;
686686
std::string buffer;
687-
PyObject *result;
688687
bool status;
689688

690689
if (!PyArg_ParseTuple(args,
@@ -741,13 +740,7 @@ static PyObject *Py_convert_to_string(PyObject *self, PyObject *args, PyObject *
741740
return NULL;
742741
}
743742

744-
if (buffer.size() == 0) {
745-
result = PyBytes_FromString("");
746-
} else {
747-
result = PyBytes_FromStringAndSize(buffer.c_str(), buffer.size());
748-
}
749-
750-
return result;
743+
return PyBytes_FromStringAndSize(buffer.c_str(), buffer.size());
751744
}
752745

753746

0 commit comments

Comments
 (0)
0