File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -677,14 +677,6 @@ const Stats = (function Stats() {
677677 function clear ( node ) {
678678 node . textContent = "" ; // Remove any `node` contents from the DOM.
679679 }
680- function getStatIndex ( pageNumber ) {
681- for ( const [ i , stat ] of stats . entries ( ) ) {
682- if ( stat . pageNumber === pageNumber ) {
683- return i ;
684- }
685- }
686- return false ;
687- }
688680 return {
689681 // Properties/functions needed by PDFBug.
690682 id : "Stats" ,
@@ -699,8 +691,8 @@ const Stats = (function Stats() {
699691 if ( ! stat ) {
700692 return ;
701693 }
702- const statsIndex = getStatIndex ( pageNumber ) ;
703- if ( statsIndex !== false ) {
694+ const statsIndex = stats . findIndex ( s => s . pageNumber === pageNumber ) ;
695+ if ( statsIndex !== - 1 ) {
704696 stats [ statsIndex ] . div . remove ( ) ;
705697 stats . splice ( statsIndex , 1 ) ;
706698 }
You can’t perform that action at this time.
0 commit comments