]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Use hash_table_update() instead of _insert() where necessary.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 3 Jun 2016 16:31:09 +0000 (19:31 +0300)
committerGitLab <gitlab@git.dovecot.net>
Fri, 3 Jun 2016 16:32:21 +0000 (19:32 +0300)
src/doveadm/doveadm-director.c
src/doveadm/doveadm-stats.c
src/lib-dict/dict-file.c
src/lib-lda/duplicate.c
src/lib-storage/index/dbox-multi/mdbox-purge.c
src/lib-storage/index/maildir/maildir-uidlist.c
src/plugins/push-notification/push-notification-drivers.c
src/pop3/pop3-commands.c

index 46b2cae2ee819d5b96037bf81bc8d83470818e37..eab67cc3c43c70a1a2a7bb6b8fa224aa6a2a76dc 100644 (file)
@@ -242,7 +242,7 @@ user_list_add(const char *username, pool_t pool,
        old_user = hash_table_lookup(users, POINTER_CAST(user_hash));
        if (old_user != NULL)
                user->next = old_user;
-       hash_table_insert(users, POINTER_CAST(user_hash), user);
+       hash_table_update(users, POINTER_CAST(user_hash), user);
 }
 
 static void ATTR_NULL(1)
index 54201ed78a83e12d168fc7c3b0ae3b69c1083f54..56b701104220debdee76a49f1ae006a0b2daeed3 100644 (file)
@@ -191,7 +191,7 @@ static void stats_read(struct top_context *ctx)
                        stats_line_set_prev_values(ctx, old_line, line);
                        array_append(&ctx->lines, &line, 1);
                }
-               hash_table_insert(ctx->sessions, line->id, line);
+               hash_table_update(ctx->sessions, line->id, line);
        }
 
        if (ctx->input->stream_errno != 0) {
index 113975ee89e18958223250970ed91f24a1f8f054..aa79b6dd84770e9625f6e6c676daa02d0fd2d94e 100644 (file)
@@ -188,7 +188,7 @@ static int file_dict_refresh(struct file_dict *dict, const char **error_r)
                                break;
 
                        value = str_tabunescape(p_strdup(dict->hash_pool, value));
-                       hash_table_insert(dict->hash, key, value);
+                       hash_table_update(dict->hash, key, value);
                }
                i_stream_destroy(&input);
        }
index 9cf1757325b6d164ca119ce98e8468993a1af349..80a3b3eddc237fe755fba499ef089f9667be60bd 100644 (file)
@@ -138,7 +138,7 @@ duplicate_read_records(struct duplicate_file *file, struct istream *input,
                        d->user = p_strndup(file->pool,
                                            data + hdr.id_size, hdr.user_size);
                        d->time = hdr.stamp;
-                       hash_table_insert(file->hash, d, d);
+                       hash_table_update(file->hash, d, d);
                } else {
                         change_count++;
                }
@@ -276,7 +276,7 @@ void duplicate_mark(struct duplicate_context *ctx,
        d->time = timestamp;
 
        ctx->file->changed = TRUE;
-       hash_table_insert(ctx->file->hash, d, d);
+       hash_table_update(ctx->file->hash, d, d);
 }
 
 void duplicate_flush(struct duplicate_context *ctx)
index a22292e465ea1b428315d1d8b53e0573a9bc2774..5fe96b07cea5c4dc2de702445d8fc8695fcf6273 100644 (file)
@@ -635,7 +635,7 @@ static int mdbox_altmove_add_files(struct mdbox_purge_context *ctx)
                }
 
                action = MDBOX_MSG_ACTION_MOVE_FROM_ALT;
-               hash_table_insert(ctx->altmoves, POINTER_CAST(cur_map_uid),
+               hash_table_update(ctx->altmoves, POINTER_CAST(cur_map_uid),
                                  POINTER_CAST(action));
                seq_range_array_add(&ctx->purge_file_ids, cur_rec.file_id);
        }
index 6208ed29cbe2fc5d0b93afbe716d74e9621efb4d..61faf4d6c1ac1a46181af0ca14a698241d59d7eb 100644 (file)
@@ -537,7 +537,7 @@ static bool maildir_uidlist_next(struct maildir_uidlist *uidlist,
                   we'll waste a bit of memory here by allocating the record
                   twice, but that's not really a problem.  */
                rec->filename = old_rec->filename;
-               hash_table_insert(uidlist->files, rec->filename, rec);
+               hash_table_update(uidlist->files, rec->filename, rec);
                uidlist->unsorted = TRUE;
                return TRUE;
        } else {
@@ -566,7 +566,7 @@ static bool maildir_uidlist_next(struct maildir_uidlist *uidlist,
        }
 
        rec->filename = p_strdup(uidlist->record_pool, line);
-       hash_table_insert(uidlist->files, rec->filename, rec);
+       hash_table_update(uidlist->files, rec->filename, rec);
        array_append(&uidlist->records, &rec, 1);
        return TRUE;
 }
index f9dba551f9fbc7478533d1c01cef8bcc92db6333..98be0700860638b4c3f91254138b587441282d5f 100644 (file)
@@ -71,7 +71,7 @@ push_notification_driver_parse_config(const char *p)
            key = *args;
            value = "";
        }
-       hash_table_insert(config->config, key, value);
+       hash_table_update(config->config, key, value);
     }
 
     return config;
index 320d4c10509a94cc1bfcca0c719740d8a56a9fbb..75582c8ccdedd2e8bc9dda0379d3d30df391421a 100644 (file)
@@ -814,7 +814,7 @@ static void client_uidls_save(struct client *client)
                i_assert(mail->seq <= client->highest_seq);
                seq_uidls[mail->seq-1] = uidl;
                if (uidl_duplicates_rename)
-                       hash_table_insert(prev_uidls, uidl, POINTER_CAST(1));
+                       hash_table_update(prev_uidls, uidl, POINTER_CAST(1));
        }
        (void)mailbox_search_deinit(&search_ctx);
        if (uidl_duplicates_rename)