Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8b0e15c

Browse filesBrowse files
committed
Remove unnecessary if/else clause.
1 parent 6c51794 commit 8b0e15c
Copy full SHA for 8b0e15c

File tree

Expand file treeCollapse file tree

1 file changed

+1
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-8
lines changed

‎src/_path_wrapper.cpp

Copy file name to clipboardExpand all lines: src/_path_wrapper.cpp
+1-8Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.