From d5246b38e68e80136bfc2a1c570189537b9de1ce Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Tue, 16 Jun 2015 18:16:18 +0530 Subject: libglusterfs: delete duplicate code This patch saves cpu cyles by deleting duplicated code in most frequently used functions 'dict_set_static_bin' & 'dict_set_bin' which is already repeated/executed in function 'bin_to_data' Change-Id: I8e18b3f2b321e06bb6bd5a67e1782cb159182dd2 BUG: 1232304 Signed-off-by: Prasanna Kumar Kalever Reviewed-on: http://review.gluster.org/11255 Reviewed-by: Niels de Vos Tested-by: NetBSD Build System Tested-by: Gluster Build System --- libglusterfs/src/dict.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c index 771dcbbc473..ce094d764b4 100644 --- a/libglusterfs/src/dict.c +++ b/libglusterfs/src/dict.c @@ -2362,8 +2362,6 @@ dict_set_bin (dict_t *this, char *key, void *ptr, size_t size) goto err; } - data->data = ptr; - data->len = size; data->is_static = 0; ret = dict_set (this, key, data); @@ -2392,10 +2390,6 @@ dict_set_static_bin (dict_t *this, char *key, void *ptr, size_t size) goto err; } - data->data = ptr; - data->len = size; - data->is_static = 1; - ret = dict_set (this, key, data); if (ret < 0) data_destroy (data); -- cgit