From e2ea6b59f52d4b513b5537c33dae543f67c729a8 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 19 Nov 2013 09:56:36 +0100 Subject: APIDump: Slight performance improvement. Strings don't need concatenation when using write(). --- MCServer/Plugins/APIDump/main.lua | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'MCServer/Plugins/APIDump/main.lua') diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua index ab154dc45..fa9d29423 100644 --- a/MCServer/Plugins/APIDump/main.lua +++ b/MCServer/Plugins/APIDump/main.lua @@ -740,14 +740,14 @@ function WriteHtmlClass(a_ClassAPI, a_AllAPI) end if (a_InheritedName ~= nil) then - cf:write("

Functions inherited from " .. a_InheritedName .. "

\n"); + cf:write("

Functions inherited from ", a_InheritedName, "

\n"); end cf:write(" \n \n \n \n \n \n \n"); for i, func in ipairs(a_Functions) do cf:write(" \n \n"); - cf:write(" \n"); - cf:write(" \n"); - cf:write(" \n \n"); + cf:write(" \n"); + cf:write(" \n"); + cf:write(" \n \n"); end cf:write("
NameParametersReturn valueNotes
" .. func.Name .. "" .. LinkifyString(func.Params or "", (a_InheritedName or a_ClassAPI.Name)).. "" .. LinkifyString(func.Return or "", (a_InheritedName or a_ClassAPI.Name)).. "" .. LinkifyString(func.Notes or "(undocumented)", (a_InheritedName or a_ClassAPI.Name)) .. "
", LinkifyString(func.Params or "", (a_InheritedName or a_ClassAPI.Name)), "", LinkifyString(func.Return or "", (a_InheritedName or a_ClassAPI.Name)), "", LinkifyString(func.Notes or "(undocumented)", (a_InheritedName or a_ClassAPI.Name)), "
\n\n"); end @@ -758,14 +758,14 @@ function WriteHtmlClass(a_ClassAPI, a_AllAPI) end if (a_InheritedName ~= nil) then - cf:write("

Constants inherited from " .. a_InheritedName .. "

\n"); + cf:write("

Constants inherited from ", a_InheritedName, "

\n"); end cf:write(" \n \n \n \n \n \n"); for i, cons in ipairs(a_Constants) do - cf:write(" \n \n"); - cf:write(" \n"); - cf:write(" \n \n"); + cf:write(" \n \n"); + cf:write(" \n"); + cf:write(" \n \n"); end cf:write("
NameValueNotes
" .. cons.Name .. "" .. cons.Value .. "" .. LinkifyString(cons.Notes or "", a_InheritedName or a_ClassAPI.Name) .. "
", cons.Name, "", cons.Value, "", LinkifyString(cons.Notes or "", a_InheritedName or a_ClassAPI.Name), "
\n\n"); end @@ -776,14 +776,14 @@ function WriteHtmlClass(a_ClassAPI, a_AllAPI) end if (a_InheritedName ~= nil) then - cf:write("

Member variables inherited from " .. a_InheritedName .. "

\n"); + cf:write("

Member variables inherited from ", a_InheritedName, "

\n"); end cf:write(" \n \n \n \n \n \n"); for i, var in ipairs(a_Variables) do - cf:write(" \n \n"); - cf:write(" \n"); - cf:write(" \n \n"); + cf:write(" \n \n"); + cf:write(" \n"); + cf:write(" \n \n"); end cf:write("
NameTypeNotes
" .. var.Name .. "" .. LinkifyString(var.Type or "(undocumented)", a_InheritedName or a_ClassAPI.Name) .. "" .. LinkifyString(var.Notes or "", a_InheritedName or a_ClassAPI.Name) .. "
", var.Name, "", LinkifyString(var.Type or "(undocumented)", a_InheritedName or a_ClassAPI.Name), "", LinkifyString(var.Notes or "", a_InheritedName or a_ClassAPI.Name), "
\n\n"); end @@ -794,7 +794,7 @@ function WriteHtmlClass(a_ClassAPI, a_AllAPI) end cf:write("\n\n"); @@ -920,7 +920,7 @@ function WriteHtmlClass(a_ClassAPI, a_AllAPI) -- Write the additional infos: if (a_ClassAPI.AdditionalInfo ~= nil) then for i, additional in ipairs(a_ClassAPI.AdditionalInfo) do - cf:write("

" .. additional.Header .. "

\n"); + cf:write("

", additional.Header, "

\n"); cf:write(LinkifyString(additional.Contents, ClassName)); end end -- cgit v1.2.3