Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
SpriteandClaude Sonnet 5.5 committed 2026-11-23 01:08:53 +00:00
1 parent dccbfd7d86
commit 17f81c60c8
20 files changed
+636 -447

No files matched your search

+9 -5
View File
@@ -9,9 +9,9 @@ priv struct RNode {
dom : Dom
is_text : Bool
tag : String
key : Int
key : Int32
mut text : String
mut n : Int
mut n : Int32
mut classes : String
mut attrs : Map[String, String]
mut props : Map[String, String]
@@ -54,7 +54,11 @@ fn new_rnode(n : @vdom.Node[@app.Msg]) -> RNode {
}
///|
fn update_rnode(r : RNode, n : @vdom.Node[@app.Msg], counter : Ref[Int]) -> Unit {
fn update_rnode(
r : RNode,
n : @vdom.Node[@app.Msg],
counter : Ref[Int32],
) -> Unit {
match n {
Text(s) =>
if s != r.text {
@@ -127,10 +131,10 @@ fn patch_children(
parent : Dom,
old : Array[RNode],
new : Array[@vdom.Node[@app.Msg]],
counter : Ref[Int],
counter : Ref[Int32],
) -> Array[RNode] {
let used : Array[Bool] = Array::make(old.length(), false)
let by_key : Map[Int, Int] = {}
let by_key : Map[Int32, Int32] = {}
for i in 0..<old.length() {
if old[i].key != 0 {
by_key[old[i].key] = i