summaryrefslogtreecommitdiff
path: root/diff-delta.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-04-15 13:50:16 -0700
committerJunio C Hamano <gitster@pobox.com>2025-04-15 13:50:17 -0700
commit7b03646f85b6eb4c0f6e05ed4b235577d3969532 (patch)
treec3daadeb7eeaf85c3dbd10b85d776f93347ce969 /diff-delta.c
parenta8c207797f2fe624c4959487e3508dde96f68976 (diff)
parentabd4192b07c5a7dbb4b13a532d0643982b42526f (diff)
Merge branch 'js/comma-semicolon-confusion'
Code clean-up. * js/comma-semicolon-confusion: detect-compiler: detect clang even if it found CUDA clang: warn when the comma operator is used compat/regex: explicitly mark intentional use of the comma operator wildmatch: avoid using of the comma operator diff-delta: avoid using the comma operator xdiff: avoid using the comma operator unnecessarily clar: avoid using the comma operator unnecessarily kwset: avoid using the comma operator unnecessarily rebase: avoid using the comma operator unnecessarily remote-curl: avoid using the comma operator unnecessarily
Diffstat (limited to 'diff-delta.c')
-rw-r--r--diff-delta.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/diff-delta.c b/diff-delta.c
index a4faf73829..71d37368d6 100644
--- a/diff-delta.c
+++ b/diff-delta.c
@@ -438,19 +438,31 @@ create_delta(const struct delta_index *index,
op = out + outpos++;
i = 0x80;
- if (moff & 0x000000ff)
- out[outpos++] = moff >> 0, i |= 0x01;
- if (moff & 0x0000ff00)
- out[outpos++] = moff >> 8, i |= 0x02;
- if (moff & 0x00ff0000)
- out[outpos++] = moff >> 16, i |= 0x04;
- if (moff & 0xff000000)
- out[outpos++] = moff >> 24, i |= 0x08;
-
- if (msize & 0x00ff)
- out[outpos++] = msize >> 0, i |= 0x10;
- if (msize & 0xff00)
- out[outpos++] = msize >> 8, i |= 0x20;
+ if (moff & 0x000000ff) {
+ out[outpos++] = moff >> 0;
+ i |= 0x01;
+ }
+ if (moff & 0x0000ff00) {
+ out[outpos++] = moff >> 8;
+ i |= 0x02;
+ }
+ if (moff & 0x00ff0000) {
+ out[outpos++] = moff >> 16;
+ i |= 0x04;
+ }
+ if (moff & 0xff000000) {
+ out[outpos++] = moff >> 24;
+ i |= 0x08;
+ }
+
+ if (msize & 0x00ff) {
+ out[outpos++] = msize >> 0;
+ i |= 0x10;
+ }
+ if (msize & 0xff00) {
+ out[outpos++] = msize >> 8;
+ i |= 0x20;
+ }
*op = i;