@@ -236,13 +236,16 @@ class NaiveHuffmanTable {
236236
237237 // Lookup a value in the table.
238238 //
239- // Return an entry with a value of `nullptr` if the value is not in the table.
239+ // The return of this method contains:
240240 //
241- // The lookup may advance `key` by `[0, key.bitLength]` bits. Typically, in a
242- // table with a single instance, or if the value is not in the table, it
243- // will advance by 0 bits. The caller is responsible for advancing its
244- // bitstream by `result.key.bitLength` bits.
245- HuffmanEntry<const T*> lookup (HuffmanLookup key) const ;
241+ // - the resulting value (`nullptr` if the value is not in the table);
242+ // - the number of bits in the entry associated to this value.
243+ //
244+ // Note that entries inside a single table are typically associated to
245+ // distinct bit lengths. The caller is responsible for checking
246+ // the result of this method and advancing the bitstream by
247+ // `result.key.bitLength` bits.
248+ HuffmanEntry<const T*> lookup (HuffmanLookup lookup) const ;
246249
247250 // The number of values in the table.
248251 size_t length () const { return values.length (); }
@@ -459,12 +462,15 @@ class SingleLookupHuffmanTable {
459462
460463 // Lookup a value in the table.
461464 //
462- // Return an entry with a value of `nullptr` if the value is not in the table.
465+ // The return of this method contains:
463466 //
464- // The lookup may advance `key` by `[0, key.bitLength]` bits. Typically, in a
465- // table with a single instance, or if the value is not in the table, it
466- // will advance by 0 bits. The caller is responsible for advancing its
467- // bitstream by `result.key.bitLength` bits.
467+ // - the resulting value (`nullptr` if the value is not in the table);
468+ // - the number of bits in the entry associated to this value.
469+ //
470+ // Note that entries inside a single table are typically associated to
471+ // distinct bit lengths. The caller is responsible for checking
472+ // the result of this method and advancing the bitstream by
473+ // `result.key.bitLength` bits.
468474 HuffmanEntry<const T*> lookup (HuffmanLookup key) const ;
469475
470476 // The number of values in the table.
@@ -654,12 +660,15 @@ class MultiLookupHuffmanTable {
654660
655661 // Lookup a value in the table.
656662 //
657- // Return an entry with a value of `nullptr` if the value is not in the table.
663+ // The return of this method contains:
658664 //
659- // The lookup may advance `key` by `[0, key.bitLength]` bits. Typically, in a
660- // table with a single instance, or if the value is not in the table, it
661- // will advance by 0 bits. The caller is responsible for advancing its
662- // bitstream by `result.key.bitLength` bits.
665+ // - the resulting value (`nullptr` if the value is not in the table);
666+ // - the number of bits in the entry associated to this value.
667+ //
668+ // Note that entries inside a single table are typically associated to
669+ // distinct bit lengths. The caller is responsible for checking
670+ // the result of this method and advancing the bitstream by
671+ // `result.key.bitLength` bits.
663672 HuffmanEntry<const T*> lookup (HuffmanLookup key) const ;
664673
665674 // The number of values in the table.
@@ -786,12 +795,15 @@ struct GenericHuffmanTable {
786795
787796 // Lookup a value in the table.
788797 //
789- // Return an entry with a value of `nullptr` if the value is not in the table.
798+ // The return of this method contains:
790799 //
791- // The lookup may advance `key` by `[0, key.bitLength]` bits. Typically, in a
792- // table with a single instance, or if the value is not in the table, it
793- // will advance by 0 bits. The caller is responsible for advancing its
794- // bitstream by `result.key.bitLength` bits.
800+ // - the resulting value (`nullptr` if the value is not in the table);
801+ // - the number of bits in the entry associated to this value.
802+ //
803+ // Note that entries inside a single table are typically associated to
804+ // distinct bit lengths. The caller is responsible for checking
805+ // the result of this method and advancing the bitstream by
806+ // `result.key.bitLength` bits.
795807 HuffmanEntry<const T*> lookup (HuffmanLookup key) const ;
796808
797809 private:
0 commit comments