summaryrefslogtreecommitdiff
path: root/source4/lib/talloc/talloc.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-09-18 11:52:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:06:53 -0500
commit22b827ccbdbac3d1b682b877050356b7a31f5c11 (patch)
tree30876f1ce39721029152a660e9ecc28aee1dd6cd /source4/lib/talloc/talloc.c
parent3e58b6fd46518abfd6b6b86623448cae63606bc0 (diff)
downloadsamba-22b827ccbdbac3d1b682b877050356b7a31f5c11.tar.gz
samba-22b827ccbdbac3d1b682b877050356b7a31f5c11.tar.bz2
samba-22b827ccbdbac3d1b682b877050356b7a31f5c11.zip
r25207: remove one nesting level and use unlikely()
metze (This used to be commit c2931540bc6e2d7665ef46a123f1c0618c3b55b7)
Diffstat (limited to 'source4/lib/talloc/talloc.c')
-rw-r--r--source4/lib/talloc/talloc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/lib/talloc/talloc.c b/source4/lib/talloc/talloc.c
index d4c845fa88..92970426e8 100644
--- a/source4/lib/talloc/talloc.c
+++ b/source4/lib/talloc/talloc.c
@@ -1186,18 +1186,18 @@ char *talloc_vasprintf(const void *t, const char *fmt, va_list ap)
va_copy(ap2, ap);
len = vsnprintf(&c, 1, fmt, ap2);
va_end(ap2);
- if (len < 0) {
+ if (unlikely(len < 0)) {
return NULL;
}
ret = (char *)__talloc(t, len+1);
- if (ret) {
- va_copy(ap2, ap);
- vsnprintf(ret, len+1, fmt, ap2);
- va_end(ap2);
- _talloc_set_name_const(ret, ret);
- }
+ if (unlikely(!ret)) return NULL;
+
+ va_copy(ap2, ap);
+ vsnprintf(ret, len+1, fmt, ap2);
+ va_end(ap2);
+ _talloc_set_name_const(ret, ret);
return ret;
}