Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
GyverLibs committed Oct 11, 2024
1 parent 7a87b99 commit 2bfa5ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=GSON
version=1.5.9
version=1.5.10
author=AlexGyver <alex@alexgyver.ru>
maintainer=AlexGyver <alex@alexgyver.ru>
sentence=Light JSON parsing and assembling library for Arduino
Expand Down
14 changes: 4 additions & 10 deletions src/utils/bson.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,16 +310,10 @@ class BSON : private gtl::stack_uniq<uint8_t> {
concat((const uint8_t*)text.str(), len, text.pgm());
}
uint8_t _uintSize(uint32_t val) {
switch (val) {
case 0ul ... 0xfful:
return 1;
case 0xfful + 1 ... 0xfffful:
return 2;
case 0xfffful + 1ul ... 0xfffffful:
return 3;
case 0xfffffful + 1ul ... 0xfffffffful:
return 4;
}
if (((uint8_t*)&val)[3]) return 4;
if (((uint8_t*)&val)[2]) return 3;
if (((uint8_t*)&val)[1]) return 2;
if (((uint8_t*)&val)[0]) return 1;
return 0;
}
uint8_t _uint64Size(uint64_t val) {
Expand Down

0 comments on commit 2bfa5ad

Please sign in to comment.