dom: improve code style

This commit is contained in:
Pierre Tachoire committed 2023-11-16 17:32:30 +01:00
1 parent a136e812ae
commit 3909fc01a7
1 file changed
+2 -4
+2 -4
View File
@@ -37,14 +37,12 @@ pub const HTMLCollection = struct {
// https://dom.spec.whatwg.org/#concept-tree-order
fn get_next(root: *parser.Node, cur: *parser.Node) ?*parser.Node {
// TODO deinit next
var next = parser.nodeFirstChild(cur);
if (next != null) {
if (parser.nodeFirstChild(cur)) |next| {
return next;
}
// TODO deinit next
next = parser.nodeNextSibling(cur);
if (next != null) {
if (parser.nodeNextSibling(cur)) |next| {
return next;
}