[squid-dev] [PATCH] coverity-fixes, part 2: SBuf hasher

Alex Rousskov rousskov at measurement-factory.com
Mon Aug 24 18:51:08 UTC 2015


On 08/24/2015 11:13 AM, Kinkie wrote:
>   this is part 2 of the coverity-fixes merge: SBuf hash.
> This code allows to have std::unordered_maps where the key is a SBuf, in
> case-sensitive and case-insensitive variants. The hashing is the same as
> used in the current Squid hash implementation (from lib/hash.cc) in
> order not to upset the current uses. More specific algorithms can be
> implemented by future users if they wish to.


> +lowSBufHash (const SBuf & sbuf, bool caseInsensitive = false) noexcept

I recommend using trailing underscore to mark low-level, "private" code
instead of "low" which may be confused with lower-case-related method,
especially in an SBuf context. Not important.

Alex.



More information about the squid-dev mailing list