From be980c4ee46ca8b9eb8e0492cf8dd06ec8426348 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Fri, 25 Jul 2014 12:23:09 +0900 Subject: Freestyle: minor optimization for space by using a pointer to a const char array instead of std::string. --- source/blender/freestyle/intern/python/BPy_SShape.cpp | 4 ++-- source/blender/freestyle/intern/python/BPy_ViewShape.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/freestyle/intern/python') diff --git a/source/blender/freestyle/intern/python/BPy_SShape.cpp b/source/blender/freestyle/intern/python/BPy_SShape.cpp index 11ed07df5de..9169adf4d9f 100644 --- a/source/blender/freestyle/intern/python/BPy_SShape.cpp +++ b/source/blender/freestyle/intern/python/BPy_SShape.cpp @@ -185,7 +185,7 @@ PyDoc_STRVAR(SShape_name_doc, static PyObject *SShape_name_get(BPy_SShape *self, void *UNUSED(closure)) { - return PyUnicode_FromString(self->ss->getName().c_str()); + return PyUnicode_FromString(self->ss->getName()); } static int SShape_name_set(BPy_SShape *self, PyObject *value, void *UNUSED(closure)) @@ -194,7 +194,7 @@ static int SShape_name_set(BPy_SShape *self, PyObject *value, void *UNUSED(closu PyErr_SetString(PyExc_TypeError, "value must be a string"); return -1; } - const string name = _PyUnicode_AsString(value); + const char *name = _PyUnicode_AsString(value); self->ss->setName(name); return 0; } diff --git a/source/blender/freestyle/intern/python/BPy_ViewShape.cpp b/source/blender/freestyle/intern/python/BPy_ViewShape.cpp index d933d9f6ed7..253bf278478 100644 --- a/source/blender/freestyle/intern/python/BPy_ViewShape.cpp +++ b/source/blender/freestyle/intern/python/BPy_ViewShape.cpp @@ -293,7 +293,7 @@ PyDoc_STRVAR(ViewShape_name_doc, static PyObject *ViewShape_name_get(BPy_ViewShape *self, void *UNUSED(closure)) { - return PyUnicode_FromString(self->vs->getName().c_str()); + return PyUnicode_FromString(self->vs->getName()); } PyDoc_STRVAR(ViewShape_id_doc, -- cgit v1.2.3