about summary refs log tree commit diff
path: root/src/liballoc/alloc
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-16 17:33:01 +0100
committerGitHub <noreply@github.com>2019-12-16 17:33:01 +0100
commita6f817f42926ab6d7487081209fbff674934b4a0 (patch)
tree971315905259a078db059080964220fc56255a4b /src/liballoc/alloc
parentf0d4b571936d4072ed90ab7750636f68f1443b3e (diff)
parent3de1923d5d3aad5c4bb0914f054e950bf166aa00 (diff)
downloadrust-a6f817f42926ab6d7487081209fbff674934b4a0.tar.gz
rust-a6f817f42926ab6d7487081209fbff674934b4a0.zip
Rollup merge of #67249 - ranma42:improve-starts-with-literal-char, r=BurntSushi
Improve code generated for `starts_with(<literal char>)`

This PR includes two minor improvements to the code generated when checking for string prefix/suffix.

The first commit simplifies the str/str operation, by taking advantage of the raw UTF-8 representation.

The second commit replaces the current str/char matching logic with a char->str encoding and then the previous method.

The resulting code should be equivalent in the generic case (one char is being encoded versus one char being decoded), but it becomes easy to optimize in the case of a literal char, which in most cases a developer might expect to be at least as simple as that of a literal string.

This PR should fix #41993
Diffstat (limited to 'src/liballoc/alloc')
0 files changed, 0 insertions, 0 deletions