@@ -104,8 +104,6 @@ namespace hash_internal {
104104// returns the size of these chunks.
105105constexpr size_t PiecewiseChunkSize () { return 1024 ; }
106106
107- // PiecewiseCombiner
108- //
109107// PiecewiseCombiner is an internal-only helper class for hashing a piecewise
110108// buffer of `char` or `unsigned char` as though it were contiguous. This class
111109// provides two methods:
@@ -130,8 +128,6 @@ class PiecewiseCombiner {
130128 PiecewiseCombiner (const PiecewiseCombiner&) = delete ;
131129 PiecewiseCombiner& operator =(const PiecewiseCombiner&) = delete ;
132130
133- // PiecewiseCombiner::add_buffer()
134- //
135131 // Appends the given range of bytes to the sequence to be hashed, which may
136132 // modify the provided hash state.
137133 template <typename H>
@@ -142,8 +138,6 @@ class PiecewiseCombiner {
142138 reinterpret_cast <const unsigned char *>(data), size);
143139 }
144140
145- // PiecewiseCombiner::finalize()
146- //
147141 // Finishes combining the hash sequence, which may may modify the provided
148142 // hash state.
149143 //
@@ -160,18 +154,15 @@ class PiecewiseCombiner {
160154 bool added_something_ = false ;
161155};
162156
163- // is_hashable()
164- //
165157// Trait class which returns true if T is hashable by the absl::Hash framework.
166158// Used for the AbslHashValue implementations for composite types below.
167159template <typename T>
168160struct is_hashable ;
169161
170- // HashStateBase
171- //
172- // An internal implementation detail that contains common implementation details
173- // for all of the "hash state objects" objects generated by Abseil. This is not
174- // a public API; users should not create classes that inherit from this.
162+ // HashStateBase is an internal implementation detail that contains common
163+ // implementation details for all of the "hash state objects" objects generated
164+ // by Abseil. This is not a public API; users should not create classes that
165+ // inherit from this.
175166//
176167// A hash state object is the template argument `H` passed to `AbslHashValue`.
177168// It represents an intermediate state in the computation of an unspecified hash
@@ -236,8 +227,6 @@ struct is_hashable;
236227template <typename H>
237228class HashStateBase {
238229 public:
239- // HashStateBase::combine()
240- //
241230 // Combines an arbitrary number of values into a hash state, returning the
242231 // updated state.
243232 //
@@ -257,8 +246,6 @@ class HashStateBase {
257246 static H combine (H state, const T& value, const Ts&... values);
258247 static H combine (H state) { return state; }
259248
260- // HashStateBase::combine_contiguous()
261- //
262249 // Combines a contiguous array of `size` elements into a hash state, returning
263250 // the updated state.
264251 //
@@ -298,8 +285,6 @@ class HashStateBase {
298285 };
299286};
300287
301- // is_uniquely_represented
302- //
303288// `is_uniquely_represented<T>` is a trait class that indicates whether `T`
304289// is uniquely represented.
305290//
@@ -334,8 +319,6 @@ class HashStateBase {
334319template <typename T, typename Enable = void >
335320struct is_uniquely_represented : std::false_type {};
336321
337- // is_uniquely_represented<unsigned char>
338- //
339322// unsigned char is a synonym for "byte", so it is guaranteed to be
340323// uniquely represented.
341324template <>
@@ -350,9 +333,6 @@ struct is_uniquely_represented<
350333 Integral, typename std::enable_if<std::is_integral<Integral>::value>::type>
351334 : std::true_type {};
352335
353- // is_uniquely_represented<bool>
354- //
355- //
356336template <>
357337struct is_uniquely_represented <bool > : std::false_type {};
358338
@@ -374,8 +354,6 @@ struct CombineRaw {
374354 }
375355};
376356
377- // hash_bytes()
378- //
379357// Convenience function that combines `hash_state` with the byte representation
380358// of `value`.
381359template <typename H, typename T,
@@ -559,8 +537,6 @@ AbslHashValue(H hash_state, const std::pair<T1, T2>& p) {
559537 return H::combine (std::move (hash_state), p.first , p.second );
560538}
561539
562- // hash_tuple()
563- //
564540// Helper function for hashing a tuple. The third argument should
565541// be an index_sequence running from 0 to tuple_size<Tuple> - 1.
566542template <typename H, typename Tuple, size_t ... Is>
@@ -881,7 +857,6 @@ typename std::enable_if<is_hashable<T>::value, H>::type AbslHashValue(
881857 return H::combine (std::move (hash_state), opt.has_value ());
882858}
883859
884- // VariantVisitor
885860template <typename H>
886861struct VariantVisitor {
887862 H&& hash_state;
@@ -930,8 +905,6 @@ H AbslHashValue(H hash_state, const std::bitset<N>& set) {
930905
931906// -----------------------------------------------------------------------------
932907
933- // hash_range_or_bytes()
934- //
935908// Mixes all values in the range [data, data+size) into the hash state.
936909// This overload accepts only uniquely-represented types, and hashes them by
937910// hashing the entire range of bytes.
@@ -942,7 +915,6 @@ hash_range_or_bytes(H hash_state, const T* data, size_t size) {
942915 return H::combine_contiguous (std::move (hash_state), bytes, sizeof (T) * size);
943916}
944917
945- // hash_range_or_bytes()
946918template <typename H, typename T>
947919typename std::enable_if<!is_uniquely_represented<T>::value, H>::type
948920hash_range_or_bytes (H hash_state, const T* data, size_t size) {
@@ -975,8 +947,6 @@ inline uint64_t PrecombineLengthMix(uint64_t state, size_t len) {
975947#define ABSL_HASH_INTERNAL_SUPPORT_LEGACY_HASH_ 0
976948#endif
977949
978- // HashSelect
979- //
980950// Type trait to select the appropriate hash implementation to use.
981951// HashSelect::type<T> will give the proper hash implementation, to be invoked
982952// as:
@@ -1073,7 +1043,6 @@ template <typename T>
10731043struct is_hashable
10741044 : std::integral_constant<bool , HashSelect::template Apply<T>::value> {};
10751045
1076- // MixingHashState
10771046class ABSL_DLL MixingHashState : public HashStateBase<MixingHashState> {
10781047 // absl::uint128 is not an alias or a thin wrapper around the intrinsic.
10791048 // We use the intrinsic when available to improve performance.
@@ -1096,8 +1065,6 @@ class ABSL_DLL MixingHashState : public HashStateBase<MixingHashState> {
10961065 MixingHashState (MixingHashState&&) = default ;
10971066 MixingHashState& operator =(MixingHashState&&) = default ;
10981067
1099- // MixingHashState::combine_contiguous()
1100- //
11011068 // Fundamental base case for hash recursion: mixes the given range of bytes
11021069 // into the hash state.
11031070 static MixingHashState combine_contiguous (MixingHashState hash_state,
@@ -1109,8 +1076,6 @@ class ABSL_DLL MixingHashState : public HashStateBase<MixingHashState> {
11091076 }
11101077 using MixingHashState::HashStateBase::combine_contiguous;
11111078
1112- // MixingHashState::hash()
1113- //
11141079 // For performance reasons in non-opt mode, we specialize this for
11151080 // integral types.
11161081 // Otherwise we would be instantiating and calling dozens of functions for
@@ -1122,7 +1087,6 @@ class ABSL_DLL MixingHashState : public HashStateBase<MixingHashState> {
11221087 Mix (Seed () ^ static_cast <std::make_unsigned_t <T>>(value), kMul ));
11231088 }
11241089
1125- // Overload of MixingHashState::hash()
11261090 template <typename T, absl::enable_if_t <!IntegralFastPath<T>::value, int > = 0 >
11271091 static size_t hash (const T& value) {
11281092 return static_cast <size_t >(combine (MixingHashState{}, value).state_ );
@@ -1332,8 +1296,6 @@ class ABSL_DLL MixingHashState : public HashStateBase<MixingHashState> {
13321296#endif
13331297 }
13341298
1335- // Seed()
1336- //
13371299 // A non-deterministic seed.
13381300 //
13391301 // The current purpose of this seed is to generate non-deterministic results
@@ -1364,7 +1326,6 @@ class ABSL_DLL MixingHashState : public HashStateBase<MixingHashState> {
13641326 uint64_t state_;
13651327};
13661328
1367- // MixingHashState::CombineContiguousImpl()
13681329inline uint64_t MixingHashState::CombineContiguousImpl (
13691330 uint64_t state, const unsigned char * first, size_t len,
13701331 std::integral_constant<int , 4 > /* sizeof_size_t */ ) {
@@ -1384,7 +1345,6 @@ inline uint64_t MixingHashState::CombineContiguousImpl(
13841345 return CombineLargeContiguousImpl32 (first, len, state);
13851346}
13861347
1387- // Overload of MixingHashState::CombineContiguousImpl()
13881348inline uint64_t MixingHashState::CombineContiguousImpl (
13891349 uint64_t state, const unsigned char * first, size_t len,
13901350 std::integral_constant<int , 8 > /* sizeof_size_t */ ) {
@@ -1414,8 +1374,6 @@ inline uint64_t MixingHashState::CombineContiguousImpl(
14141374
14151375struct AggregateBarrier {};
14161376
1417- // HashImpl
1418-
14191377// Add a private base class to make sure this type is not an aggregate.
14201378// Aggregates can be aggregate initialized even if the default constructor is
14211379// deleted.
@@ -1444,22 +1402,19 @@ H HashStateBase<H>::combine(H state, const T& value, const Ts&... values) {
14441402 values...);
14451403}
14461404
1447- // HashStateBase::combine_contiguous()
14481405template <typename H>
14491406template <typename T>
14501407H HashStateBase<H>::combine_contiguous(H state, const T* data, size_t size) {
14511408 return hash_internal::hash_range_or_bytes (std::move (state), data, size);
14521409}
14531410
1454- // HashStateBase::combine_unordered()
14551411template <typename H>
14561412template <typename I>
14571413H HashStateBase<H>::combine_unordered(H state, I begin, I end) {
14581414 return H::RunCombineUnordered (std::move (state),
14591415 CombineUnorderedCallback<I>{begin, end});
14601416}
14611417
1462- // HashStateBase::PiecewiseCombiner::add_buffer()
14631418template <typename H>
14641419H PiecewiseCombiner::add_buffer (H state, const unsigned char * data,
14651420 size_t size) {
@@ -1492,7 +1447,6 @@ H PiecewiseCombiner::add_buffer(H state, const unsigned char* data,
14921447 return state;
14931448}
14941449
1495- // HashStateBase::PiecewiseCombiner::finalize()
14961450template <typename H>
14971451H PiecewiseCombiner::finalize (H state) {
14981452 // Do not call combine_contiguous with empty remainder since it is modifying
0 commit comments