Github user maskit commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/542#discussion_r58230651
  
    --- Diff: proxy/hdrs/MIME.cc ---
    @@ -473,7 +473,8 @@ mime_hdr_set_accelerator_slotnum(MIMEHdrImpl *mh, 
int32_t slot_id, uint32_t slot
     inline void
     mime_hdr_set_accelerators_and_presence_bits(MIMEHdrImpl *mh, MIMEField 
*field)
     {
    -  int slot_id, slot_num;
    +  int slot_id;
    +  ptrdiff_t slot_num;
    --- End diff --
    
    I could do that but I didn't because the check below is not exactly the 
same as the another one.
    If I use ``contains()`` here, the code would be like this:
    
    ``` c
      if (slot_id != MIME_SLOTID_NONE) {
        if (mh->m_first_fblock.contains(field)) {                               
         
          slot_num = (field - &(mh->m_first_fblock.m_field_slots[0]));
          if ((slot_num < 0) || (slot_num >= MIME_FIELD_SLOTNUM_UNKNOWN)) {
            slot_num = MIME_FIELD_SLOTNUM_UNKNOWN;
          }
        } else {
          slot_num = MIME_FIELD_SLOTNUM_UNKNOWN;
        }
        mime_hdr_set_accelerator_slotnum(mh, slot_id, 
MIME_FIELD_SLOTNUM_UNKNOWN);
      }
    ```
    
    It's not so readable, isn't it?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to