about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-04-07 17:17:09 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-04-07 20:22:41 +0530
commit684e2aace5670efd1df8c578baeefa7739cd2be1 (patch)
tree6a3517045daa12be986e4bba1d0a8eade4e44d1d /src/libstd/sys
parent76e2349c4417788e03f877fe18d13b521b455a4b (diff)
parenta6c27be0b1074684ae918ab7132bbeb8f75d4f2a (diff)
downloadrust-684e2aace5670efd1df8c578baeefa7739cd2be1.tar.gz
rust-684e2aace5670efd1df8c578baeefa7739cd2be1.zip
Rollup merge of #32699 - bluss:slice-memcmp, r=alexcrichton
Specialize equality for [T] and comparison for [u8] to use memcmp when possible

Specialize equality for [T] and comparison for [u8] to use memcmp when possible

Where T is a type that can be compared for equality bytewise, we can use
memcmp. We can also use memcmp for PartialOrd, Ord for [u8].

Use specialization to call memcmp in PartialEq for slices for certain element types. This PR does not change the user visible API since the implementation uses an intermediate trait. See commit messages for more information.

The memcmp signature was changed from `*const i8` to `*const u8` which is in line with how the memcmp function is defined in C (taking const void * arguments, interpreting the values as unsigned bytes for purposes of the comparison).
Diffstat (limited to 'src/libstd/sys')
0 files changed, 0 insertions, 0 deletions