File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ type NodeEx = Node & {
20
20
} ;
21
21
22
22
function upper_bound ( low : number , high : number , key : ( index : number ) => number , value : number ) {
23
- // Return first index of value larger than input value
23
+ // Return first index of value larger than input value in the range [low, high)
24
24
while ( low < high ) {
25
25
const mid = low + ( ( high - low ) >> 1 ) ;
26
26
if ( key ( mid ) <= value ) {
@@ -69,7 +69,7 @@ function init_hydrate(target: NodeEx) {
69
69
// Find the largest subsequence length such that it ends in a value less than our current value
70
70
71
71
// upper_bound returns first greater value, so we subtract one
72
- const seqLen = upper_bound ( 1 , 0 , idx => children [ m [ idx ] ] . claim_order , current ) - 1 ;
72
+ const seqLen = upper_bound ( 1 , longest + 1 , idx => children [ m [ idx ] ] . claim_order , current ) - 1 ;
73
73
74
74
p [ i ] = m [ seqLen ] + 1 ;
75
75
@@ -366,7 +366,7 @@ export function claim_text(nodes: ChildNodeArray, data) {
366
366
return claim_node < Text > (
367
367
nodes ,
368
368
( node : ChildNode ) : node is Text => node . nodeType === 3 ,
369
- ( node : Text ) => node . data = '' + data ,
369
+ ( node : Text ) => { node . data = '' + data } ,
370
370
( ) => text ( data ) ,
371
371
true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements
372
372
) ;
You can’t perform that action at this time.
0 commit comments