Skip to content

Commit

Permalink
refactor: remove uneeded string_map_representation
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed May 10, 2015
1 parent 8ba82d6 commit acd1c43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/cassandra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ local function shuffle(t)
end

local function startup(self)
local body = encoding.string_map_representation({["CQL_VERSION"]=CQL_VERSION})
local body = encoding.map_representation({["CQL_VERSION"]=CQL_VERSION})
local response, err = protocol.send_frame_and_get_response(self,
constants.op_codes.STARTUP, body)
if not response then
Expand Down
13 changes: 1 addition & 12 deletions src/cassandra/encoding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,6 @@ local function short_bytes_representation(bytes)
return short_representation(#bytes) .. bytes
end

local function string_map_representation(map)
local buffer = {}
local n = 0
for k, v in pairs(map) do
buffer[#buffer + 1] = string_representation(k)
buffer[#buffer + 1] = string_representation(v)
n = n + 1
end
return short_representation(n) .. table.concat(buffer)
end

local function boolean_representation(value)
if value then return "\001" else return "\000" end
end
Expand Down Expand Up @@ -240,11 +229,11 @@ end
-- Public interface
--

_M.map_representation = map_representation
_M.int_representation = int_representation
_M.short_representation = short_representation
_M.bytes_representation = bytes_representation
_M.boolean_representation = boolean_representation
_M.string_map_representation = string_map_representation
_M.short_bytes_representation = short_bytes_representation
_M.long_string_representation = long_string_representation

Expand Down

0 comments on commit acd1c43

Please sign in to comment.