FOLLY_ALWAYS_INLINE void CompactProtocolReader::readFieldBeginWithStateImpl(
    StructReadState& state,
    int16_t prevFieldId,
    uint8_t firstByte) {
  if (firstByte == detail::compact::CT_STOP) {
    state.fieldType = TType::T_STOP;
    return;
  }

  int16_t modifier = (firstByte & 0xf0) >> 4;
  if (modifier != 0) {
    state.fieldId = prevFieldId + modifier;
  } else {
    // not a delta, look ahead for the zigzag varint field id.
    readI16(state.fieldId);
  }

  uint8_t type = firstByte & 0xf;
  state.fieldType = getType(type);

  // if this happens to be a boolean field, the value is encoded in the type
  if (type == detail::compact::CT_BOOLEAN_TRUE ||
      type == detail::compact::CT_BOOLEAN_FALSE) {
    // save the boolean value in a special instance variable.
    boolValue_.hasBoolValue = true;
    boolValue_.boolValue = type == detail::compact::CT_BOOLEAN_TRUE;
  }
}
FOLLY_ALWAYS_INLINE void CompactProtocolReader::readFieldBeginWithStateImpl(
    StructReadState& state,
    int16_t prevFieldId,
    uint8_t firstByte) {
  if (firstByte == detail::compact::CT_STOP) {
    state.fieldType = TType::T_STOP;
    return;
  }

  int16_t modifier = (firstByte & 0xf0) >> 4;
  if (modifier != 0) {
    state.fieldId = prevFieldId + modifier;
  } else {
     
    readI16(state.fieldId);
  }

  uint8_t type = firstByte & 0xf;
  state.fieldType = getType(type);

   
  if (type == detail::compact::CT_BOOLEAN_TRUE ||
      type == detail::compact::CT_BOOLEAN_FALSE) {
     
    boolValue_.hasBoolValue = true;
    boolValue_.boolValue = type == detail::compact::CT_BOOLEAN_TRUE;
  }
}