summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2015-06-16 18:16:18 +0530
committerNiels de Vos <ndevos@redhat.com>2015-07-12 14:28:44 -0700
commitd5246b38e68e80136bfc2a1c570189537b9de1ce (patch)
tree582b527e51522b91e22b6681a33e74e497c4ffe2
parent3a6b3dae15bba00860c3323ff8867c4845b877d6 (diff)
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 <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/11255 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--libglusterfs/src/dict.c6
1 files changed, 0 insertions, 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);