Skip to content

Commit

Permalink
Merge pull request #464 from fxamacker/fxamacker/refactor-simple-value
Browse files Browse the repository at this point in the history
Fix cbor.SimpleValue encoding and decoding
  • Loading branch information
fxamacker authored Jan 2, 2024
2 parents 95e432d + bfcaa81 commit f4ccee0
Show file tree
Hide file tree
Showing 5 changed files with 299 additions and 16 deletions.
5 changes: 0 additions & 5 deletions decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -1002,11 +1002,6 @@ func (d *decoder) parseToValue(v reflect.Value, tInfo *typeInfo) error { //nolin
f := math.Float64frombits(val)
return fillFloat(t, f, v)
default: // ai <= 24
// Decode simple values (including false, true, null, and undefined)
if tInfo.nonPtrType == typeSimpleValue {
v.SetUint(val)
return nil
}
switch ai {
case 20, 21:
return fillBool(t, ai == 21, v)
Expand Down
Loading

0 comments on commit f4ccee0

Please sign in to comment.