aws-c-common icon indicating copy to clipboard operation
aws-c-common copied to clipboard

"reflexive" vs. "symmetric" in hash_table.h doc

Open sfsiegel opened this issue 5 years ago • 1 comments

The documentation for function aws_hash_callback_eq_fn in hash_table.h states

Equality functions used in a hash table must be reflexive (i.e., a == b if and only if b == a)...

"Reflexive" means a==a for all a. A relation satisfying (a==b iff b==a) is "symmetric". Probably you want to require that equality functions are reflexive, symmetric, and transitive, i.e., that they are equivalence relations.

For comparison, see https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-

sfsiegel avatar Oct 06 '19 13:10 sfsiegel

Thanks for letting us know. We’ll update it.

JonathanHenson avatar Oct 06 '19 16:10 JonathanHenson