Skip to content

Commit 9f53847

Browse files
committed
---
yaml --- r: 276541 b: refs/heads/try c: f621193 h: refs/heads/master i: 276539: 05dcd25
1 parent 1182e28 commit 9f53847

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 80e7a1be359fc0de4eb17056230ae2fc130b7090
4+
refs/heads/try: f621193e5ea7ac54fcd37f0e730e955fd9f61200
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/libcore/str/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1892,7 +1892,10 @@ impl StrExt for str {
18921892

18931893
#[inline]
18941894
fn is_char_boundary(&self, index: usize) -> bool {
1895-
if index == self.len() { return true; }
1895+
// 0 and len are always ok.
1896+
// Test for 0 explicitly so that it can optimize out the check
1897+
// easily and skip reading string data for that case.
1898+
if index == 0 || index == self.len() { return true; }
18961899
match self.as_bytes().get(index) {
18971900
None => false,
18981901
Some(&b) => b < 128 || b >= 192,

0 commit comments

Comments
 (0)