diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-09-17 14:42:55 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-09-17 14:47:14 +0200 |
commit | 63e7b7afa75252298606c84e8ec82adaee5fa28a (patch) | |
tree | bce989a5797c5926dbe64c9ae55876de51c06acb | |
parent | 528d698f97ef89635ac17f01530dd40a0cc5a7d0 (diff) |
Don't violate unordered container hash+pred requirements
"Two values k1 and k2 of type Key are considered equivalent if the container's
key equality predicate returns true when passed those values. If k1 and k2 are
equivalent, the container's hash function shall return the same value for both."
[unord.req]
But for INetContentTypeParameterList, all inserted keys are already lower-case
by construction, and all queries happen to be done with (literal) lower-case
keys, so just document the requirement here that insertion and query needs to be
done with lower-case keys.
Change-Id: Ic46845b7bb0376e995e7736b57fa80c777d1c263
-rw-r--r-- | include/tools/inetmime.hxx | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/include/tools/inetmime.hxx b/include/tools/inetmime.hxx index 78dd8e5f2db3..b5d478623803 100644 --- a/include/tools/inetmime.hxx +++ b/include/tools/inetmime.hxx @@ -106,17 +106,9 @@ struct INetContentTypeParameter } }; -struct OString_equalsIgnoreAsciiCase -{ - bool operator()(const OString& r1, const OString& r2) const - { - return r1.equalsIgnoreAsciiCase(r2); - } -}; - -// the key is the m_sAttribute again -typedef std::unordered_map<OString, INetContentTypeParameter, OStringHash, - OString_equalsIgnoreAsciiCase> INetContentTypeParameterList; +// the key is the m_sAttribute again; all keys are lower case: +typedef std::unordered_map<OString, INetContentTypeParameter, OStringHash> + INetContentTypeParameterList; class TOOLS_DLLPUBLIC INetMIME |