Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm committed Apr 9, 2024
1 parent 7ffdcaa commit 1e19135
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions packages/svelte/src/internal/client/dom/blocks/svelte-head.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,10 @@ export function head(render_fn) {
head_anchor = /** @type {import('#client').TemplateNode} */ (document.head.firstChild);
}

var depth = 0;

while (head_anchor !== null) {
if (head_anchor.nodeType === 8) {
var data = /** @type {Comment} */ (head_anchor).data;
if (data === HYDRATION_START) {
if (depth === 0) {
break;
}
depth++;
}
if (data === HYDRATION_END) {
depth--;
}
}
while (
head_anchor.nodeType !== 8 ||
/** @type {Comment} */ (head_anchor).data !== HYDRATION_START
) {
head_anchor = /** @type {import('#client').TemplateNode} */ (head_anchor.nextSibling);
}

Expand Down

0 comments on commit 1e19135

Please sign in to comment.