vstyle diff: performance improvement

This commit is contained in:
Andreas Rumpf 2017-06-05 10:25:46 +02:00
commit 06f5283709

View file

@ -146,7 +146,9 @@ proc eq*(a, b: VNode): bool =
if a.attrs.len != b.attrs.len: return false if a.attrs.len != b.attrs.len: return false
for i in 0..<a.attrs.len: for i in 0..<a.attrs.len:
if a.attrs[i] != b.attrs[i]: return false if a.attrs[i] != b.attrs[i]: return false
if a.style != b.style: return false # Do not compare styles here. The idea is that nodes only
# differing in styling can be made equal easily enough:
#if a.style != b.style: return false
result = true result = true
proc setAttr*(n: VNode; key: cstring; val: cstring = "") = proc setAttr*(n: VNode; key: cstring; val: cstring = "") =