[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Fri Dec 7 14:34:04 UTC 2018


The branch, master has been updated
       via  7b60d72f672 librpc:ndr: Give the optimizer hints for ndr_push_bytes()
      from  d5f9bc45e22 Removed dead groups link from Mail List Etiquette

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 7b60d72f67231e7675b0fad724edd59a0b3f4444
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 6 09:35:15 2018 +0100

    librpc:ndr: Give the optimizer hints for ndr_push_bytes()
    
    Also remove the redundant check in ndr_push_DATA_BLOB.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Fri Dec  7 15:33:38 CET 2018 on sn-devel-144

-----------------------------------------------------------------------

Summary of changes:
 librpc/ndr/ndr_basic.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c
index b488c7c22d9..3a5189570c5 100644
--- a/librpc/ndr/ndr_basic.c
+++ b/librpc/ndr/ndr_basic.c
@@ -719,10 +719,10 @@ _PUBLIC_ enum ndr_err_code ndr_pull_trailer_align(struct ndr_pull *ndr, size_t s
 */
 _PUBLIC_ enum ndr_err_code ndr_push_bytes(struct ndr_push *ndr, const uint8_t *data, uint32_t n)
 {
-	if (n == 0) {
+	if (unlikely(n == 0)) {
 		return NDR_ERR_SUCCESS;
 	}
-	if (data == NULL) {
+	if (unlikely(data == NULL)) {
 		return NDR_ERR_INVALID_POINTER;
 	}
 	NDR_PUSH_NEED_BYTES(ndr, n);
@@ -1335,10 +1335,6 @@ _PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flag
 	} else {
 		NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, blob.length));
 	}
-	if (blob.length == 0) {
-		return NDR_ERR_SUCCESS;
-	}
-
 	NDR_CHECK(ndr_push_bytes(ndr, blob.data, blob.length));
 	return NDR_ERR_SUCCESS;
 }


-- 
Samba Shared Repository



More information about the samba-cvs mailing list