summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2014-10-27 15:42:23 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2014-10-27 15:42:23 +0800
commit53151f00720d5cd2df8cf196f4523d4f5b831598 (patch)
tree9ab32b58d1e243c662be315161ce0214122fb7ad /src
parent[INPUT] Replace open-coded flushall in preadbuffer (diff)
downloaddash-53151f00720d5cd2df8cf196f4523d4f5b831598.tar.gz
dash-53151f00720d5cd2df8cf196f4523d4f5b831598.zip
[OUTPUT] Add likely tag in outmem
The branch in outmem where the string fits in the buffer is the
common case and is now marked as likely.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--src/output.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/output.c b/src/output.c
index 1b20850..3e1ae25 100644
--- a/src/output.c
+++ b/src/output.c
@@ -144,7 +144,7 @@ outmem(const char *p, size_t len, struct output *dest)
 	size_t nleft;
 
 	nleft = dest->end - dest->nextc;
-	if (nleft >= len) {
+	if (likely(nleft >= len)) {
 buffered:
 		dest->nextc = mempcpy(dest->nextc, p, len);
 		return;