Mercurial > vim
changeset 4381:48a22f36ff45 v7.3.939
updated for version 7.3.939
Problem: Using Py_BuildValue is inefficient sometimes.
Solution: Use PyLong_FromLong(). (ZyX)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 12 May 2013 19:09:51 +0200 |
parents | a8ec47f1aa54 |
children | 977fbe80d49f |
files | src/if_py_both.h src/version.c |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -1838,10 +1838,10 @@ WindowAttr(WindowObject *this, char *nam return Py_BuildValue("(ll)", (long)(pos->lnum), (long)(pos->col)); } else if (strcmp(name, "height") == 0) - return Py_BuildValue("l", (long)(this->win->w_height)); + return PyLong_FromLong((long)(this->win->w_height)); #ifdef FEAT_VERTSPLIT else if (strcmp(name, "width") == 0) - return Py_BuildValue("l", (long)(W_WIDTH(this->win))); + return PyLong_FromLong((long)(W_WIDTH(this->win))); #endif else if (strcmp(name, "vars") == 0) return DictionaryNew(this->win->w_vars);