uint32_t CompactProtocolWriter::writeFieldBeginInternal(
    const char* /*name*/,
    const TType fieldType,
    const int16_t fieldId,
    int8_t typeOverride) {
  uint32_t wsize = 0;

  // if there's a type override, use that.
  int8_t typeToWrite =
      (typeOverride == -1 ? detail::compact::TTypeToCType[fieldType]
                          : typeOverride);

  // check if we can use delta encoding for the field id
  if (fieldId > lastFieldId_ && fieldId - lastFieldId_ <= 15) {
    // write them together
    wsize += writeByte((fieldId - lastFieldId_) << 4 | typeToWrite);
  } else {
    // write them separate
    wsize += writeByte(typeToWrite);
    wsize += writeI16(fieldId);
  }

  lastFieldId_ = fieldId;
  return wsize;
}
uint32_t CompactProtocolWriter::writeFieldBeginInternal(
    const char*  ,
    const TType fieldType,
    const int16_t fieldId,
    int8_t typeOverride) {
  uint32_t wsize = 0;

   
  int8_t typeToWrite =
      (typeOverride == -1 ? detail::compact::TTypeToCType[fieldType]
                          : typeOverride);

   
  if (fieldId > lastFieldId_ && fieldId - lastFieldId_ <= 15) {
     
    wsize += writeByte((fieldId - lastFieldId_) << 4 | typeToWrite);
  } else {
     
    wsize += writeByte(typeToWrite);
    wsize += writeI16(fieldId);
  }

  lastFieldId_ = fieldId;
  return wsize;
}