# HG changeset patch # User Matthew Wild # Date 1241463211 -3600 # Node ID a1cf1d623695ea242539b1fbd723bdf67b65f45a # Parent ececc4162d589cfc9dc3c17a6ee9c4805f47f4d3 net.http, net.httpserver: Remove urlcodes table... it really isn't needed (thanks Jan Harkes) diff -r ececc4162d58 -r a1cf1d623695 net/http.lua --- a/net/http.lua Wed Apr 22 20:31:45 2009 +0100 +++ b/net/http.lua Mon May 04 19:53:31 2009 +0100 @@ -15,7 +15,6 @@ local log = require "util.logger".init("http"); local print = function () end -local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber("0x"..k)); return t[k]; end }); local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%02x", c:byte()); end)); end module "http" diff -r ececc4162d58 -r a1cf1d623695 net/httpserver.lua --- a/net/httpserver.lua Wed Apr 22 20:31:45 2009 +0100 +++ b/net/httpserver.lua Mon May 04 19:53:31 2009 +0100 @@ -8,10 +8,9 @@ local listener; local t_insert, t_concat = table.insert, table.concat; -local s_match, s_gmatch, s_char = string.match, string.gmatch; +local s_match, s_gmatch = string.match, string.gmatch; local tonumber, tostring, pairs = tonumber, tostring, pairs; -local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = s_char(tonumber("0x"..k)); return t[k]; end }); local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end local log = require "util.logger".init("httpserver");