Skip to content

Commit 1e19135

Browse files
committed
simplify
1 parent 7ffdcaa commit 1e19135

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

packages/svelte/src/internal/client/dom/blocks/svelte-head.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,10 @@ export function head(render_fn) {
3333
head_anchor = /** @type {import('#client').TemplateNode} */ (document.head.firstChild);
3434
}
3535

36-
var depth = 0;
37-
38-
while (head_anchor !== null) {
39-
if (head_anchor.nodeType === 8) {
40-
var data = /** @type {Comment} */ (head_anchor).data;
41-
if (data === HYDRATION_START) {
42-
if (depth === 0) {
43-
break;
44-
}
45-
depth++;
46-
}
47-
if (data === HYDRATION_END) {
48-
depth--;
49-
}
50-
}
36+
while (
37+
head_anchor.nodeType !== 8 ||
38+
/** @type {Comment} */ (head_anchor).data !== HYDRATION_START
39+
) {
5140
head_anchor = /** @type {import('#client').TemplateNode} */ (head_anchor.nextSibling);
5241
}
5342

0 commit comments

Comments
 (0)