diff options
| author | Pádraig Brady <P@draigBrady.com> | 2015-10-22 14:34:08 +0100 |
|---|---|---|
| committer | Pádraig Brady <P@draigBrady.com> | 2015-10-27 17:25:12 +0000 |
| commit | 9459d9d8112fe7816022665b5016c2014bb625f3 (patch) | |
| tree | 80486d9f4331e149f6e7ef7381acbac1613ffb31 /scripts/git-hooks/commit-msg | |
| parent | all: quote string arguments in error messages (diff) | |
| download | coreutils-9459d9d8112fe7816022665b5016c2014bb625f3.tar.gz coreutils-9459d9d8112fe7816022665b5016c2014bb625f3.zip | |
copy,dd: simplify and optimize NUL bytes detection
* src/factor.c: Move LIKELY() definition to...
* src/system.h: ...here.
(is_nul): Reimplement with a version that doesn't
require a sentinel after the buffer, and which calls
down to (the system optimized) memcmp.
Performance analyzed at http://rusty.ozlabs.org/?p=560
* src/dd.c (alloc_obuf): Simplify the is_nul() call by
not needing to write the sentinel.
* src/copy.c (sparse_copy): Likewise.
(copy_reg): Simplify the buffer allocation by avoiding
consideration of the sentinel in the buffer size calculation.
Diffstat (limited to 'scripts/git-hooks/commit-msg')
0 files changed, 0 insertions, 0 deletions
