aboutsummaryrefslogtreecommitdiff
path: root/obj.c
diff options
context:
space:
mode:
Diffstat (limited to 'obj.c')
-rw-r--r--obj.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/obj.c b/obj.c
index b410e7c..f896214 100644
--- a/obj.c
+++ b/obj.c
@@ -87,15 +87,12 @@ addvert(OBJ *obj, OBJVertex v, int vtype)
static void
addelem(OBJObject *o, OBJElem *e)
{
- OBJElem *ep;
-
- if(o->child == nil){
- o->child = e;
+ if(o->lastone == nil){
+ o->lastone = o->child = e;
return;
}
- for(ep = o->child; ep->next != nil; ep = ep->next)
- ;
- ep->next = e;
+ o->lastone->next = e;
+ o->lastone = o->lastone->next;
}
static OBJElem *