]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
src/include/encoding.h: reduce amount of 0-byte appends
authorPiotr Dałek <piotr.dalek@ts.fujitsu.com>
Thu, 25 Jun 2015 12:36:41 +0000 (14:36 +0200)
committerPiotr Dałek <piotr.dalek@ts.fujitsu.com>
Tue, 4 Aug 2015 07:56:30 +0000 (09:56 +0200)
commit2219200cb5bac1272fbee1e28d2fefecd5e657b7
tree7736e7767484157cb601087cddcb2f21abcdd47f
parent03877d683df55d04db6950df24899c1b9e8bb6b9
src/include/encoding.h: reduce amount of 0-byte appends

Some encoding functions (in particular, encoders for strings) right now
use two encode() calls, one for data length and one for actual data. This
change makes encoding functions aware of the data length and don't call
second encode if there's no actual data to encode - conditional branch is
faster than function call.

Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
src/include/encoding.h