diff options
| author | Ulrik Sverdrup <bluss@users.noreply.github.com> | 2016-04-05 14:06:20 +0200 |
|---|---|---|
| committer | Ulrik Sverdrup <bluss@users.noreply.github.com> | 2016-04-05 14:06:20 +0200 |
| commit | 5d56e1daed3aab8149ecbf69baf5bc1785f08627 (patch) | |
| tree | 2d86430d73b671e5b2ccd494278490130645cc6c /src/libsyntax/errors | |
| parent | a09f386e8d1c31133f0ce1123fbeaedcff40a77d (diff) | |
| download | rust-5d56e1daed3aab8149ecbf69baf5bc1785f08627.tar.gz rust-5d56e1daed3aab8149ecbf69baf5bc1785f08627.zip | |
Specialize equality for [T] and comparison for [u8]
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] and by extension &str. This is an improvement for example for the comparison [u8] == [u8] that used to emit a loop that compared the slices byte by byte. One worry here could be that this introduces function calls to memcmp in contexts where it should really inline the comparison or even optimize it out, but llvm takes care of recognizing memcmp specifically.
Diffstat (limited to 'src/libsyntax/errors')
0 files changed, 0 insertions, 0 deletions
