[PATCH 3/9] [OUTPUT] Add likely tag in outmem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx>
---

 ChangeLog    |    1 +
 src/output.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index e6d6cbf..9d2dc7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
 	* Add printf support for format string a, A, and F.
 	* Handle embedded NULs correctly in printf.
 	* Replace open-coded flushall in preadbuffer.
+	* Add likely tag in outmem.
 
 2014-10-13  Eric Blake <eblake@xxxxxxxxxx>
 
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;
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux