aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHong Shin <hongshin@google.com>2024-05-09 17:16:10 -0700
committerCopybara-Service <copybara-worker@google.com>2024-05-09 17:18:24 -0700
commitd071c608780d3fa890b191aafb8aa2d4f8634973 (patch)
treec3a2c1ab34f3ec8d087f3d3efff951980fd92d27
parentfefec687536234a46f96d0c6e209dabceaf18466 (diff)
downloadprotobuf-d071c608780d3fa890b191aafb8aa2d4f8634973.tar.gz
Break out idx in upb_MiniTableSub computation for clarity
PiperOrigin-RevId: 632314763
-rw-r--r--upb/mini_descriptor/link.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/upb/mini_descriptor/link.c b/upb/mini_descriptor/link.c
index bc5fa2f65..093150b62 100644
--- a/upb/mini_descriptor/link.c
+++ b/upb/mini_descriptor/link.c
@@ -50,12 +50,12 @@ bool upb_MiniTable_SetSubMessage(upb_MiniTable* table,
return false;
}
- upb_MiniTableSub* table_sub =
- (void*)&table->UPB_PRIVATE(subs)[field->UPB_PRIVATE(submsg_index)];
+ int idx = field->UPB_PRIVATE(submsg_index);
+ upb_MiniTableSub* table_subs = (void*)table->UPB_PRIVATE(subs);
// TODO: Add this assert back once YouTube is updated to not call
// this function repeatedly.
// UPB_ASSERT(UPB_PRIVATE(_upb_MiniTable_IsEmpty)(table_sub->submsg));
- *table_sub = upb_MiniTableSub_FromMessage(sub);
+ table_subs[idx] = upb_MiniTableSub_FromMessage(sub);
return true;
}