From 2129361fa08b44e0e20bd7ca338d6076ea037c0e Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Thu, 16 Nov 2023 16:12:30 +0100 Subject: [PATCH] dom: is_wildcard is never changed --- src/dom/html_collection.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dom/html_collection.zig b/src/dom/html_collection.zig index b6877e8c..2d1eb268 100644 --- a/src/dom/html_collection.zig +++ b/src/dom/html_collection.zig @@ -72,7 +72,7 @@ pub const HTMLCollection = struct { const imatch = try std.ascii.allocUpperString(allocator, self.match); defer allocator.free(imatch); - var is_wildcard = std.mem.eql(u8, self.match, "*"); + const is_wildcard = std.mem.eql(u8, self.match, "*"); while (true) { ntype = parser.nodeType(node); @@ -93,7 +93,7 @@ pub const HTMLCollection = struct { var node: *parser.Node = self.root; var ntype: parser.NodeType = undefined; - var is_wildcard = std.mem.eql(u8, self.match, "*"); + const is_wildcard = std.mem.eql(u8, self.match, "*"); // Use the current state to improve speed if possible. if (self.cur_idx != null and index >= self.cur_idx.?) { @@ -136,7 +136,7 @@ pub const HTMLCollection = struct { var node: *parser.Node = self.root; var ntype: parser.NodeType = undefined; - var is_wildcard = std.mem.eql(u8, self.match, "*"); + const is_wildcard = std.mem.eql(u8, self.match, "*"); const imatch = try std.ascii.allocUpperString(allocator, self.match); defer allocator.free(imatch);