Skip to content

Commit

Permalink
Fix documentation to match implementation
Browse files Browse the repository at this point in the history
Boolean values are encoded as `BOOLEAN_TRUE` and `BOOLEAN_FALSE` which are defined as 1 and 2 instead of 1 and 0.

The element-type of a bool is encoded as `BOOLEAN_TRUE` so 1 instead of 2.
  • Loading branch information
mpoeter authored Dec 13, 2024
1 parent 9171491 commit e227a56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/specs/thrift-compact-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ early implementation bug that finally became the de-facto standard.

Booleans are encoded differently depending on whether it is a field value (in a struct) or an element value (in a set,
list or map). Field values are encoded directly in the field header. Element values of type `bool` are sent as an
`int8`; true as `1` and false as `0`.
`int8`; true as `1` and false as `2`.

### Universal unique identifier encoding

Expand Down Expand Up @@ -249,7 +249,7 @@ The short form should be used when the length is in the range 0 - 14 (inclusive)

The following element-types are used (see note below):

* `BOOL`, encoded as `2`
* `BOOL`, encoded as `1`
* `I8`, encoded as `3`
* `I16`, encoded as `4`
* `I32`, encoded as `5`
Expand Down

0 comments on commit e227a56

Please sign in to comment.