@@ -331,7 +331,12 @@ export class Overlay<T = string> implements Printable, Stateful {
331331 hash = this . refreshSlices ( hash , txt . savedSlices ) ;
332332 hash = this . refreshSlices ( hash , txt . extraSlices ) ;
333333 hash = this . refreshSlices ( hash , txt . localSlices ) ;
334- if ( ! slicesOnly ) hash = this . computeSplitTextHashes ( hash ) ;
334+
335+ // TODO: Move test hash calculation out of the overlay.
336+ if ( ! slicesOnly ) {
337+ // hash = updateRga(hash, txt.str);
338+ hash = this . refreshTextSlices ( hash ) ;
339+ }
335340 return ( this . hash = hash ) ;
336341 }
337342
@@ -461,7 +466,7 @@ export class Overlay<T = string> implements Printable, Stateful {
461466
462467 public leadingTextHash : number = 0 ;
463468
464- protected computeSplitTextHashes ( stateTotal : number ) : number {
469+ protected refreshTextSlices ( stateTotal : number ) : number {
465470 const txt = this . txt ;
466471 const str = txt . str ;
467472 const firstChunk = str . first ( ) ;
@@ -472,7 +477,6 @@ export class Overlay<T = string> implements Printable, Stateful {
472477 let state : number = CONST . START_STATE ;
473478 for ( let pair = i ( ) ; pair ; pair = i ( ) ) {
474479 const [ p1 , p2 ] = pair ;
475- // TODO: need to incorporate slice attribute hash here?
476480 const id1 = p1 . id ;
477481 state = ( state << 5 ) + state + ( id1 . sid >>> 0 ) + id1 . time ;
478482 let overlayPointHash = CONST . START_STATE ;
@@ -482,10 +486,8 @@ export class Overlay<T = string> implements Printable, Stateful {
482486 ( overlayPointHash << 5 ) + overlayPointHash + ( ( ( ( id . sid >>> 0 ) + id . time ) << 8 ) + ( off << 4 ) + len ) ;
483487 } ) ;
484488 state = updateNum ( state , overlayPointHash ) ;
485- if ( p1 ) {
486- p1 . hash = overlayPointHash ;
487- stateTotal = updateNum ( stateTotal , overlayPointHash ) ;
488- }
489+ p1 . hash = overlayPointHash ;
490+ stateTotal = updateNum ( stateTotal , overlayPointHash ) ;
489491 if ( p2 instanceof MarkerOverlayPoint ) {
490492 if ( marker ) {
491493 marker . textHash = state ;
0 commit comments