aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/stat_process.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-13 17:46:50 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-13 17:46:50 +0100
commitd2a938d398d31fae55e709a4e219b5acfa5c7622 (patch)
tree616ee4dacde622e13ee26f4437febf9e5eae4661 /src/libstat/stat_process.c
parent444c70ff896dcd07f1569e394b528cf1f61dec54 (diff)
downloadrspamd-d2a938d398d31fae55e709a4e219b5acfa5c7622.tar.gz
rspamd-d2a938d398d31fae55e709a4e219b5acfa5c7622.zip
Rework parts and task structure:
- Now text_parts, parts and received are arrays - Pre-allocate arrays with some reasonable defaults - Use arrays instead of lists in plugins and checks - Remove unused fields from task structure - Rework mime_foreach callback function - Remove deprecated scan_milliseconds field
Diffstat (limited to 'src/libstat/stat_process.c')
-rw-r--r--src/libstat/stat_process.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index 9c261eccd..d147a29d3 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -308,12 +308,10 @@ rspamd_stat_process_tokenize (struct rspamd_tokenizer_config *cf,
struct mime_text_part *part;
GArray *words;
gchar *sub;
- GList *cur;
-
- cur = task->text_parts;
+ guint i;
- while (cur != NULL) {
- part = (struct mime_text_part *)cur->data;
+ for (i = 0; i < task->text_parts->len; i ++) {
+ part = g_ptr_array_index (task->text_parts, i);
if (!IS_PART_EMPTY (part) && part->words != NULL) {
if (compat) {
@@ -325,8 +323,6 @@ rspamd_stat_process_tokenize (struct rspamd_tokenizer_config *cf,
part->normalized_words, tok->tokens, IS_PART_UTF (part));
}
}
-
- cur = g_list_next (cur);
}
if (task->subject != NULL) {