From c2dca42a4ffd7bb173be0ec8fa48896c079af80b Mon Sep 17 00:00:00 2001 From: artemp Date: Tue, 7 Aug 2012 17:01:03 +0100 Subject: [PATCH] + use Py_RETURN_NONE + cleanup/simplify --- bindings/python/mapnik_value_converter.hpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/bindings/python/mapnik_value_converter.hpp b/bindings/python/mapnik_value_converter.hpp index dc2fc62cf..34b88e9de 100644 --- a/bindings/python/mapnik_value_converter.hpp +++ b/bindings/python/mapnik_value_converter.hpp @@ -51,24 +51,19 @@ namespace boost { namespace python { PyObject * operator() (std::string const& s) const { - PyObject *obj = Py_None; - obj = ::PyUnicode_DecodeUTF8(s.c_str(),implicit_cast(s.length()),0); - return obj; + return ::PyUnicode_DecodeUTF8(s.c_str(),implicit_cast(s.length()),0); } PyObject * operator() (UnicodeString const& s) const { std::string buffer; mapnik::to_utf8(s,buffer); - PyObject *obj = Py_None; - obj = ::PyUnicode_DecodeUTF8(buffer.c_str(),implicit_cast(buffer.length()),0); - return obj; + return ::PyUnicode_DecodeUTF8(buffer.c_str(),implicit_cast(buffer.length()),0); } PyObject * operator() (mapnik::value_null const& /*s*/) const { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } };