@@ -156,12 +156,12 @@ impl Mutations {
156156 const MESSAGES_COUNT_MAX_SIZE : usize = usize:: POSTCARD_MAX_SIZE ;
157157 let mut tick_buffer = [ 0 ; RepliconTick :: POSTCARD_MAX_SIZE ] ;
158158 let update_tick = postcard:: to_slice ( & ticks. update_tick , & mut tick_buffer) ?;
159- let mut metadata_size =
159+ let mut base_header_size =
160160 size_of :: < MutateFlags > ( ) + update_tick. len ( ) + server_tick_range. len ( ) ;
161161 if track_mutate_messages {
162162 // We don't know the number of messages ahead of time, so we assume the maximum
163163 // possible size during the splits calculation to avoid exceeding MTU.
164- metadata_size += MESSAGES_COUNT_MAX_SIZE ;
164+ base_header_size += MESSAGES_COUNT_MAX_SIZE ;
165165 }
166166
167167 let mut mutate_info = MutateInfo {
@@ -172,7 +172,7 @@ impl Mutations {
172172 } ;
173173 let mut mutate_index = ticks. next_mutate_index ( ) ;
174174 let mut chunks = EntityChunks :: new ( & mut self . related , & mut self . standalone ) ;
175- let mut header_size = metadata_size + serialized_size ( & mutate_index) ?;
175+ let mut header_size = base_header_size + serialized_size ( & mutate_index) ?;
176176 let mut body_size = 0 ;
177177 let mut chunks_range = Range :: < usize > :: default ( ) ;
178178 for chunk in chunks. iter_mut ( ) {
@@ -201,7 +201,7 @@ impl Mutations {
201201 entities : Default :: default ( ) ,
202202 } ;
203203 chunks_range. start = chunks_range. end ;
204- header_size = metadata_size + serialized_size ( & mutate_index) ?; // Recalculate since the mutate index changed.
204+ header_size = base_header_size + serialized_size ( & mutate_index) ?; // Recalculate since the mutate index changed.
205205 body_size = 0 ;
206206 }
207207
0 commit comments