Skip to content

Commit 46e56bf

Browse files
committed
Use the same style
1 parent 533ea27 commit 46e56bf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

xmlua/document.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ do -- C14N methods
312312
-- @tparam[opt=false] boolean with_comments if truthy, comments will be included
313313
-- @return string containing canonicalized XML, or throws an error if it fails
314314
function methods:canonicalize(select, opts)
315+
select = select or {} -- default to include all nodes in the output
315316
opts = opts or {}
316317
local with_comments = opts.with_comments and 1 or 0 -- default = not including comments
317318

@@ -326,9 +327,6 @@ do -- C14N methods
326327
local output_buffer = libxml2.xmlOutputBufferCreate(buffer)
327328

328329
local success
329-
if select == nil then
330-
select = {} -- default to include all nodes in the output
331-
end
332330
if type(select) == "function" then -- callback function
333331
-- wrap the callback to pass wrapped objects, and return 1 or 0
334332
local callback = function(_, xml_node, xml_parent)

0 commit comments

Comments
 (0)