dom: improve code style

This commit is contained in:
Pierre Tachoire
2023-11-16 16:56:48 +01:00
parent a136e812ae
commit 3909fc01a7

View File

@@ -37,14 +37,12 @@ pub const HTMLCollection = struct {
// https://dom.spec.whatwg.org/#concept-tree-order // https://dom.spec.whatwg.org/#concept-tree-order
fn get_next(root: *parser.Node, cur: *parser.Node) ?*parser.Node { fn get_next(root: *parser.Node, cur: *parser.Node) ?*parser.Node {
// TODO deinit next // TODO deinit next
var next = parser.nodeFirstChild(cur); if (parser.nodeFirstChild(cur)) |next| {
if (next != null) {
return next; return next;
} }
// TODO deinit next // TODO deinit next
next = parser.nodeNextSibling(cur); if (parser.nodeNextSibling(cur)) |next| {
if (next != null) {
return next; return next;
} }