Remove redundant comments that just name the following symbol without providing additional information. PiperOrigin-RevId: 768168977 Change-Id: Ic7fb411878e303a0749cd00e3ebf19d02b745546
diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h index 30aede2..7825219 100644 --- a/absl/hash/internal/hash.h +++ b/absl/hash/internal/hash.h
@@ -104,8 +104,6 @@ // returns the size of these chunks. constexpr size_t PiecewiseChunkSize() { return 1024; } -// PiecewiseCombiner -// // PiecewiseCombiner is an internal-only helper class for hashing a piecewise // buffer of `char` or `unsigned char` as though it were contiguous. This class // provides two methods: @@ -130,8 +128,6 @@ PiecewiseCombiner(const PiecewiseCombiner&) = delete; PiecewiseCombiner& operator=(const PiecewiseCombiner&) = delete; - // PiecewiseCombiner::add_buffer() - // // Appends the given range of bytes to the sequence to be hashed, which may // modify the provided hash state. template <typename H> @@ -142,8 +138,6 @@ reinterpret_cast<const unsigned char*>(data), size); } - // PiecewiseCombiner::finalize() - // // Finishes combining the hash sequence, which may may modify the provided // hash state. // @@ -160,18 +154,15 @@ bool added_something_ = false; }; -// is_hashable() -// // Trait class which returns true if T is hashable by the absl::Hash framework. // Used for the AbslHashValue implementations for composite types below. template <typename T> struct is_hashable; -// HashStateBase -// -// An internal implementation detail that contains common implementation details -// for all of the "hash state objects" objects generated by Abseil. This is not -// a public API; users should not create classes that inherit from this. +// HashStateBase is an internal implementation detail that contains common +// implementation details for all of the "hash state objects" objects generated +// by Abseil. This is not a public API; users should not create classes that +// inherit from this. // // A hash state object is the template argument `H` passed to `AbslHashValue`. // It represents an intermediate state in the computation of an unspecified hash @@ -236,8 +227,6 @@ template <typename H> class HashStateBase { public: - // HashStateBase::combine() - // // Combines an arbitrary number of values into a hash state, returning the // updated state. // @@ -257,8 +246,6 @@ static H combine(H state, const T& value, const Ts&... values); static H combine(H state) { return state; } - // HashStateBase::combine_contiguous() - // // Combines a contiguous array of `size` elements into a hash state, returning // the updated state. // @@ -298,8 +285,6 @@ }; }; -// is_uniquely_represented -// // `is_uniquely_represented<T>` is a trait class that indicates whether `T` // is uniquely represented. // @@ -334,8 +319,6 @@ template <typename T, typename Enable = void> struct is_uniquely_represented : std::false_type {}; -// is_uniquely_represented<unsigned char> -// // unsigned char is a synonym for "byte", so it is guaranteed to be // uniquely represented. template <> @@ -350,9 +333,6 @@ Integral, typename std::enable_if<std::is_integral<Integral>::value>::type> : std::true_type {}; -// is_uniquely_represented<bool> -// -// template <> struct is_uniquely_represented<bool> : std::false_type {}; @@ -374,8 +354,6 @@ } }; -// hash_bytes() -// // Convenience function that combines `hash_state` with the byte representation // of `value`. template <typename H, typename T, @@ -559,8 +537,6 @@ return H::combine(std::move(hash_state), p.first, p.second); } -// hash_tuple() -// // Helper function for hashing a tuple. The third argument should // be an index_sequence running from 0 to tuple_size<Tuple> - 1. template <typename H, typename Tuple, size_t... Is> @@ -881,7 +857,6 @@ return H::combine(std::move(hash_state), opt.has_value()); } -// VariantVisitor template <typename H> struct VariantVisitor { H&& hash_state; @@ -930,8 +905,6 @@ // ----------------------------------------------------------------------------- -// hash_range_or_bytes() -// // Mixes all values in the range [data, data+size) into the hash state. // This overload accepts only uniquely-represented types, and hashes them by // hashing the entire range of bytes. @@ -942,7 +915,6 @@ return H::combine_contiguous(std::move(hash_state), bytes, sizeof(T) * size); } -// hash_range_or_bytes() template <typename H, typename T> typename std::enable_if<!is_uniquely_represented<T>::value, H>::type hash_range_or_bytes(H hash_state, const T* data, size_t size) { @@ -975,8 +947,6 @@ #define ABSL_HASH_INTERNAL_SUPPORT_LEGACY_HASH_ 0 #endif -// HashSelect -// // Type trait to select the appropriate hash implementation to use. // HashSelect::type<T> will give the proper hash implementation, to be invoked // as: @@ -1073,7 +1043,6 @@ struct is_hashable : std::integral_constant<bool, HashSelect::template Apply<T>::value> {}; -// MixingHashState class ABSL_DLL MixingHashState : public HashStateBase<MixingHashState> { // absl::uint128 is not an alias or a thin wrapper around the intrinsic. // We use the intrinsic when available to improve performance. @@ -1096,8 +1065,6 @@ MixingHashState(MixingHashState&&) = default; MixingHashState& operator=(MixingHashState&&) = default; - // MixingHashState::combine_contiguous() - // // Fundamental base case for hash recursion: mixes the given range of bytes // into the hash state. static MixingHashState combine_contiguous(MixingHashState hash_state, @@ -1109,8 +1076,6 @@ } using MixingHashState::HashStateBase::combine_contiguous; - // MixingHashState::hash() - // // For performance reasons in non-opt mode, we specialize this for // integral types. // Otherwise we would be instantiating and calling dozens of functions for @@ -1122,7 +1087,6 @@ Mix(Seed() ^ static_cast<std::make_unsigned_t<T>>(value), kMul)); } - // Overload of MixingHashState::hash() template <typename T, absl::enable_if_t<!IntegralFastPath<T>::value, int> = 0> static size_t hash(const T& value) { return static_cast<size_t>(combine(MixingHashState{}, value).state_); @@ -1332,8 +1296,6 @@ #endif } - // Seed() - // // A non-deterministic seed. // // The current purpose of this seed is to generate non-deterministic results @@ -1364,7 +1326,6 @@ uint64_t state_; }; -// MixingHashState::CombineContiguousImpl() inline uint64_t MixingHashState::CombineContiguousImpl( uint64_t state, const unsigned char* first, size_t len, std::integral_constant<int, 4> /* sizeof_size_t */) { @@ -1384,7 +1345,6 @@ return CombineLargeContiguousImpl32(first, len, state); } -// Overload of MixingHashState::CombineContiguousImpl() inline uint64_t MixingHashState::CombineContiguousImpl( uint64_t state, const unsigned char* first, size_t len, std::integral_constant<int, 8> /* sizeof_size_t */) { @@ -1414,8 +1374,6 @@ struct AggregateBarrier {}; -// HashImpl - // Add a private base class to make sure this type is not an aggregate. // Aggregates can be aggregate initialized even if the default constructor is // deleted. @@ -1444,14 +1402,12 @@ values...); } -// HashStateBase::combine_contiguous() template <typename H> template <typename T> H HashStateBase<H>::combine_contiguous(H state, const T* data, size_t size) { return hash_internal::hash_range_or_bytes(std::move(state), data, size); } -// HashStateBase::combine_unordered() template <typename H> template <typename I> H HashStateBase<H>::combine_unordered(H state, I begin, I end) { @@ -1459,7 +1415,6 @@ CombineUnorderedCallback<I>{begin, end}); } -// HashStateBase::PiecewiseCombiner::add_buffer() template <typename H> H PiecewiseCombiner::add_buffer(H state, const unsigned char* data, size_t size) { @@ -1492,7 +1447,6 @@ return state; } -// HashStateBase::PiecewiseCombiner::finalize() template <typename H> H PiecewiseCombiner::finalize(H state) { // Do not call combine_contiguous with empty remainder since it is modifying