Diff

net/httpserver.lua @ 1111:a1cf1d623695

net.http, net.httpserver: Remove urlcodes table... it really isn't needed (thanks Jan Harkes)
author Matthew Wild <mwild1@gmail.com>
date Mon, 04 May 2009 19:53:31 +0100
parent 1110:ececc4162d58
child 1112:e8a00a2ea910
child 1113:89ac8e9e1426
line wrap: on
line diff
--- 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");