Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1423)

Issue 6305077: Face Sorting

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by ideasman42
Modified:
11 years, 11 months ago
Reviewers:
ospite
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Patch Set 1 #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -0 lines) Patch
M source/blender/python/bmesh/bmesh_py_types.c View 5 chunks +200 lines, -0 lines 12 comments Download

Messages

Total messages: 1
ideasman42
11 years, 11 months ago (2012-06-09 16:38:55 UTC) #1
http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
File source/blender/python/bmesh/bmesh_py_types.c (right):

http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
source/blender/python/bmesh/bmesh_py_types.c:2148: int ok = FALSE;
I can see what you are going for here but think overall using GOTO's here isn't
a benefit because the cases can be handled without gotos, will add some comments
below.

http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
source/blender/python/bmesh/bmesh_py_types.c:2159: goto out;
just return NULL.

http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
source/blender/python/bmesh/bmesh_py_types.c:2165: goto out;
just return NULL.

http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
source/blender/python/bmesh/bmesh_py_types.c:2178: goto out;
just return NULL.

http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
source/blender/python/bmesh/bmesh_py_types.c:2193: goto out_free_keys;
free keys and return NULL.

http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
source/blender/python/bmesh/bmesh_py_types.c:2196: if (!PyNumber_Check(index)) {
This isnt very obvious in py api but its faster not to use PyNumber_Check, and
do this instead...


val = PyFloat_AsDouble(index);
if (val == -1 && PyErr_Occurred()) {
 .... error case ...
}

This means the common case is fast.

http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
source/blender/python/bmesh/bmesh_py_types.c:2200: goto out_free_keys;
free keys and return NULL.

http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
source/blender/python/bmesh/bmesh_py_types.c:2217: goto out_free_keys;
free keys and return NULL.

http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
source/blender/python/bmesh/bmesh_py_types.c:2229: qsort_r(elem_idx, n_elem,
sizeof(*elem_idx), elem_idx_compare_by_keys, keys);
we have run into this before, we _could_ have our own implementation of qsort_r
for systems that dont have it.

http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
source/blender/python/bmesh/bmesh_py_types.c:2234: goto out_free_elem_idx;
a few more frees are needed here, can see in this instance goto's do simplify a
bit but still prefer not to use goto's

http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
source/blender/python/bmesh/bmesh_py_types.c:2257: PyErr_Format(PyExc_TypeError,
"element type %d not supported", self->itype);
better do this check at the beginning of the function before any allocations.

http://codereview.appspot.com/6305077/diff/1/source/blender/python/bmesh/bmes...
source/blender/python/bmesh/bmesh_py_types.c:2262: BM_mesh_elem_index_ensure(bm,
htype);
wouldnt re-calculate index values here, just set the flag as dirty, maybe the
caller wants these index values to be left alone.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b