Permalink
Browse files

shave a whole millisecond off of parsing mesh.json by using an approp…

…riately sized type enum...
  • Loading branch information...
chadaustin committed Apr 15, 2017
1 parent 9cbfdd4 commit 799c55fcd3b582b31df44caa9ccc249bc5393210
Showing with 3 additions and 1 deletion.
  1. +3 −1 include/sajson.h
View
@@ -40,13 +40,15 @@
#if defined(__GNUC__) || defined(__clang__)
#define SAJSON_LIKELY(x) __builtin_expect(!!(x), 1)
#define SAJSON_UNLIKELY(x) __builtin_expect(!!(x), 0)
+#define SAJSON_ALWAYS_INLINE __attribute__((always_inline))
#else
#define SAJSON_LIKELY(x) x
#define SAJSON_UNLIKELY(x) x
+#define SAJSON_ALWAYS_INLINE __forceinline
#endif
namespace sajson {
- enum type {
+ enum type: uint8_t {
TYPE_INTEGER = 0,
TYPE_DOUBLE = 1,
TYPE_NULL = 2,

0 comments on commit 799c55f

Please sign in to comment.