# HG changeset patch
# User ZyX <[email protected]>
# Date 1366994569 -14400
# Branch python-extended-2
# Node ID 9ad3778f7284550c7dff2792f284ceea1e9c7bf1
# Parent  4f40c3dc35eaf077a6154a41fa55eacb0a3a3616
Remove useless Py_BuildValue calls

Direct use of PyLong_FromLong should be faster

diff -r 4f40c3dc35ea -r 9ad3778f7284 src/if_py_both.h
--- a/src/if_py_both.h  Fri Apr 26 21:02:06 2013 +0400
+++ b/src/if_py_both.h  Fri Apr 26 20:42:49 2013 +0400
@@ -1838,10 +1838,10 @@
        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);

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


*** /tmp/extdiff.acdrfQ/vim.4f40c3dc35ea/src/if_py_both.h	2013-04-26 21:03:47.777425176 +0400
--- vim.9ad3778f7284/src/if_py_both.h	2013-04-26 21:03:47.781425140 +0400
***************
*** 1838,1847 ****
  	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));
  #ifdef FEAT_VERTSPLIT
      else if (strcmp(name, "width") == 0)
! 	return Py_BuildValue("l", (long)(W_WIDTH(this->win)));
  #endif
      else if (strcmp(name, "vars") == 0)
  	return DictionaryNew(this->win->w_vars);
--- 1838,1847 ----
  	return Py_BuildValue("(ll)", (long)(pos->lnum), (long)(pos->col));
      }
      else if (strcmp(name, "height") == 0)
! 	return PyLong_FromLong((long)(this->win->w_height));
  #ifdef FEAT_VERTSPLIT
      else if (strcmp(name, "width") == 0)
! 	return PyLong_FromLong((long)(W_WIDTH(this->win)));
  #endif
      else if (strcmp(name, "vars") == 0)
  	return DictionaryNew(this->win->w_vars);

Raspunde prin e-mail lui