Kaydet (Commit) 63e7b7af authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 528d698f
...@@ -106,17 +106,9 @@ struct INetContentTypeParameter ...@@ -106,17 +106,9 @@ struct INetContentTypeParameter
} }
}; };
struct OString_equalsIgnoreAsciiCase // the key is the m_sAttribute again; all keys are lower case:
{ typedef std::unordered_map<OString, INetContentTypeParameter, OStringHash>
bool operator()(const OString& r1, const OString& r2) const INetContentTypeParameterList;
{
return r1.equalsIgnoreAsciiCase(r2);
}
};
// the key is the m_sAttribute again
typedef std::unordered_map<OString, INetContentTypeParameter, OStringHash,
OString_equalsIgnoreAsciiCase> INetContentTypeParameterList;
class TOOLS_DLLPUBLIC INetMIME class TOOLS_DLLPUBLIC INetMIME
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment