maskit commented on code in PR #11657:
URL: https://github.com/apache/trafficserver/pull/11657#discussion_r1706017977


##########
src/proxy/hdrs/XPACK.cc:
##########
@@ -501,25 +501,28 @@ XpackDynamicTable::_make_space(uint64_t 
extra_space_needed)
     return extra_space_needed == 0;
   }
   uint32_t freed = 0;
-  uint32_t tail  = this->_calc_index(this->_entries_tail, 1);
+  uint32_t tail  = this->_entries_tail;
 
   while (extra_space_needed > freed) {
-    if (this->_entries_head < tail) {
-      break;
-    }
+    tail = this->_calc_index(tail, 1); // Move to the next entry
+
     if (this->_entries[tail].ref_count) {
       break;
     }
     freed += this->_entries[tail].name_len + this->_entries[tail].value_len + 
ADDITIONAL_32_BYTES;
-    tail   = this->_calc_index(tail, 1);
+    if (this->_entries_head == tail) {

Review Comment:
   Or we could also append the check to the condition for the `while` statement.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to