|
20th August 2003, 01:19 PM | #1 |
Senior Member
Professional user
Join Date: Jun 2003
Location: British Columbia, Canada
Posts: 255
|
add_*_head vs add_*
Another 'why' question, here...
Given the performance benefits of add_*_head, why would one use the non-head variants? What do they do differently, and why? I'm referring to the vertex and surface routines in particular, here, not the vanilla linked-list manipulators. -- Jeff |
20th August 2003, 05:38 PM | #2 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,565
|
Re: add_*_head vs add_*
Head adds a new item to the start of a list (very fast) and ordinary add versions append to the end - which means that the end must be found first (potentially quite slow).
Internally, the order of some lists is important e.g. vertices in a surface. children lists. You should use the _head versions of the list functions if the order is not important (or you want to perhaps reverse a list). Generally, try not to manipulate the geometry list structures directly but use the functions instead e.g. object_remove_vertex. Andy |
|
|