Also remove the redundant check in ndr_push_DATA_BLOB.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Dec 7 15:33:38 CET 2018 on sn-devel-144
*/
_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);
} 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;
}