Skip to content

Commit ca02b03

Browse files
committed
Simplify.
1 parent f726dc4 commit ca02b03

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

pdal/plang/Environment.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,12 @@ std::string readPythonString(PyObject* dict, const std::string& key)
8787
std::string s;
8888

8989
PyObject* o = PyDict_GetItemString(dict, key.c_str());
90-
if (!o)
91-
return s;
92-
93-
PyObject* r = PyObject_Str(o);
94-
if (r)
95-
s = PyUnicode_AsUTF8AndSize(r, NULL);
96-
90+
if (o)
91+
{
92+
PyObject* r = PyObject_Str(o);
93+
if (r)
94+
s = PyUnicode_AsUTF8AndSize(r, NULL);
95+
}
9796
return s;
9897
}
9998

0 commit comments

Comments
 (0)