Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 20th August 2003, 01:19 PM   #1
Thaellin
Senior Member
Professional user
 
Join Date: Jun 2003
Location: British Columbia, Canada
Posts: 255
Default 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
Thaellin is offline   Reply With Quote
Old 20th August 2003, 05:38 PM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default 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
Andy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 04:04 AM.


AC3D Forum
(C) Inivis Limited 2020