[cvs] SF.net SVN: bogofilter:[6815] trunk/bogofilter/src/listsort.c
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <re...@us...> - 2009-02-21 21:10:07
|
Revision: 6815 http://bogofilter.svn.sourceforge.net/bogofilter/?rev=6815&view=rev Author: relson Date: 2009-02-21 21:10:04 +0000 (Sat, 21 Feb 2009) Log Message: ----------- Correct editing error. Modified Paths: -------------- trunk/bogofilter/src/listsort.c Modified: trunk/bogofilter/src/listsort.c =================================================================== --- trunk/bogofilter/src/listsort.c 2009-02-21 21:04:46 UTC (rev 6814) +++ trunk/bogofilter/src/listsort.c 2009-02-21 21:10:04 UTC (rev 6815) @@ -171,35 +171,34 @@ listsort(NULL, cmp, 0, 0); - for (i = 0; i < sizeof(order)/sizeof(*order); i++) { - int *ord = order[i]; - head = &k[ord[0]]; - for (j = 0; j < n; j++) { - if (j == n-1) - k[ord[j]].next = NULL; - else - k[ord[j]].next = &k[ord[j+1]]; - } - - printf("before:"); - p = head; - do { - printf(" %d", p->i); - p = p->next; - } while (p != NULL); - printf("\t"); - head = listsort(head, cmp); - printf(" after:"); - p = head; - do { - printf(" %d", p->i); - p = p->next; - } while (p != NULL); - printf("\n"); - } - printf("\n"); + for (i = 0; i < sizeof(order)/sizeof(*order); i++) { + int *ord = order[i]; + head = &k[ord[0]]; + for (j = 0; j < n; j++) { + if (j == n-1) + k[ord[j]].next = NULL; + else + k[ord[j]].next = &k[ord[j+1]]; } + + printf("before:"); + p = head; + do { + printf(" %d", p->i); + p = p->next; + } while (p != NULL); + printf("\t"); + head = listsort(head, cmp); + printf(" after:"); + p = head; + do { + printf(" %d", p->i); + p = p->next; + } while (p != NULL); + printf("\n"); } + printf("\n"); + return 0; } #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |