Skip to content

Commit

Permalink
Fix Boolean datatype
Browse files Browse the repository at this point in the history
So the Lua FFI seems to already take care of converting
C `bool` to a Lua `boolean`. Comparing it with 1 means that
Boolean values always end up `false`.

Just remove the comparison and this fixes it.
  • Loading branch information
Hoops committed Mar 29, 2020
1 parent be2f319 commit 8778d1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/resty/maxminddb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ local function _dump_entry_data_list(entry_data_list,status)
elseif data_type == MMDB_DATA_TYPE_UINT32 then
val = entry_data_item.uint32
elseif data_type == MMDB_DATA_TYPE_BOOLEAN then
val = entry_data_item.boolean == 1
val = entry_data_item.boolean
elseif data_type == MMDB_DATA_TYPE_UINT64 then
val = entry_data_item.uint64
elseif data_type == MMDB_DATA_TYPE_INT32 then
Expand Down

0 comments on commit 8778d1c

Please sign in to comment.