@@ -1677,11 +1677,7 @@ class SimpleSegmentVisitor {
16771677 }
16781678
16791679 // Combines exported symbols from all referred segments
1680- let symbols = this . symbols ;
1681- if ( ! symbols ) {
1682- this . symbols = symbols = { } ;
1683- }
1684-
1680+ const symbols = ( this . symbols ||= { } ) ;
16851681 const inputSymbols = [ ] ;
16861682 for ( const referredSegment of referredSegments ) {
16871683 const referredSymbols = symbols [ referredSegment ] ;
@@ -1766,10 +1762,7 @@ class SimpleSegmentVisitor {
17661762 }
17671763
17681764 onPatternDictionary ( dictionary , currentSegment , data , start , end ) {
1769- let patterns = this . patterns ;
1770- if ( ! patterns ) {
1771- this . patterns = patterns = { } ;
1772- }
1765+ const patterns = ( this . patterns ||= { } ) ;
17731766 const decodingContext = new DecodingContext ( data , start , end ) ;
17741767 patterns [ currentSegment ] = decodePatternDictionary (
17751768 dictionary . mmr ,
@@ -1811,10 +1804,7 @@ class SimpleSegmentVisitor {
18111804 }
18121805
18131806 onTables ( currentSegment , data , start , end ) {
1814- let customTables = this . customTables ;
1815- if ( ! customTables ) {
1816- this . customTables = customTables = { } ;
1817- }
1807+ const customTables = ( this . customTables ||= { } ) ;
18181808 customTables [ currentSegment ] = decodeTablesSegment ( data , start , end ) ;
18191809 }
18201810}
@@ -1865,10 +1855,7 @@ class HuffmanTreeNode {
18651855 this . children [ bit ] = new HuffmanTreeNode ( line ) ;
18661856 } else {
18671857 // Create an intermediate node and continue recursively.
1868- let node = this . children [ bit ] ;
1869- if ( ! node ) {
1870- this . children [ bit ] = node = new HuffmanTreeNode ( null ) ;
1871- }
1858+ const node = ( this . children [ bit ] ||= new HuffmanTreeNode ( null ) ) ;
18721859 node . buildTree ( line , shift - 1 ) ;
18731860 }
18741861 }
0 commit comments