|
From: Henri A. <has...@us...> - 2004-10-29 23:54:32
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22467 Modified Files: langlist.c Log Message: Record additions now always happen from the right side to the left, with de-duping. List additions can happen from left to right or right to left, depending on their relative size. The real solution for lists should be to simply link them instead of add, but I'm still trying to decypher the data structures. Index: langlist.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langlist.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** langlist.c 29 Oct 2004 09:02:23 -0000 1.3 --- langlist.c 29 Oct 2004 23:54:20 -0000 1.4 *************** *** 907,911 **** n = opcountlistitems ((*v2).data.listvalue); ! if ( m > n ) { /* the first list is longer than the second: append to the first */ list2 = (*v2).data.listvalue; *vreturned = *v1; --- 907,915 ---- n = opcountlistitems ((*v2).data.listvalue); ! if ( (m > n) || (**(*v2).data.listvalue).isrecord ) { ! /* Either the first list is longer than the second: ! append to the first, or we are adding records so we want to ! de-dupe the entries always in the same way ! */ list2 = (*v2).data.listvalue; *vreturned = *v1; *************** *** 922,929 **** return (false); ! if ((**list3).isrecord) { if (opgetlisthandle (list3, -1, key, &hignore)) ! disposehandle (hitem); else oppushhandle (list3, key, hitem); --- 926,933 ---- return (false); ! if ((**list3).isrecord) { /* discard duplicate keys */ if (opgetlisthandle (list3, -1, key, &hignore)) ! disposehandle (hitem); /* discard the duplicate. don't push it over */ else oppushhandle (list3, key, hitem); *************** *** 948,960 **** return (false); ! if ((**list3).isrecord) { ! ! if (opgetlisthandle (list3, -1, key, &hignore)) ! disposehandle (hitem); ! else ! opunshifthandle (list3, key, hitem); ! } ! else ! opunshifthandle (list3, key, hitem); } /*for*/ } --- 952,956 ---- return (false); ! opunshifthandle (list3, key, hitem); } /*for*/ } |