Use gperf - not faster yet
This commit is contained in:
34
src/json_tokens.gperf
Normal file
34
src/json_tokens.gperf
Normal file
@@ -0,0 +1,34 @@
|
||||
%{
|
||||
#include <string.h>
|
||||
%}
|
||||
%define hash-function-name hash_json_token
|
||||
%define lookup-function-name lookup_json_token
|
||||
%language=C++
|
||||
%global-table
|
||||
%struct-type
|
||||
%readonly-tables
|
||||
%compare-lengths
|
||||
|
||||
struct JsonToken {
|
||||
const char* name;
|
||||
int token_id;
|
||||
};
|
||||
|
||||
%%
|
||||
"preconditions", 1
|
||||
"operations", 2
|
||||
"request_id", 3
|
||||
"leader_id", 4
|
||||
"read_version", 5
|
||||
"type", 6
|
||||
"key", 7
|
||||
"begin", 8
|
||||
"end", 9
|
||||
"value", 10
|
||||
"version", 11
|
||||
"point_read", 12
|
||||
"range_read", 13
|
||||
"write", 14
|
||||
"delete", 15
|
||||
"range_delete", 16
|
||||
%%
|
||||
Reference in New Issue
Block a user