Skip to content

Commit 3f67d92

Browse files
author
blake2-ppc
committed
---
yaml --- r: 80499 b: refs/heads/master c: e34e203 h: refs/heads/master i: 80497: 176cabb 80495: 1196322 v: v3
1 parent 5836030 commit 3f67d92

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8fce135326707264d99102cdb514b00d6aa38081
2+
refs/heads/master: e34e2032e8ca028fb622b60ad4aa07f9e86bfe35
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cbd1eefbd350797b783df119fed7956d7e1c74ad
55
refs/heads/try: 71bebebc37fbb229877da88dde13c2f35913bd77

trunk/src/libstd/str.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3897,4 +3897,23 @@ mod bench {
38973897
with_capacity(100);
38983898
}
38993899
}
3900+
3901+
#[bench]
3902+
fn bench_push_str(bh: &mut BenchHarness) {
3903+
let s = "ศไทย中华Việt Nam; Mary had a little lamb, Little lamb";
3904+
do bh.iter {
3905+
let mut r = ~"";
3906+
r.push_str(s);
3907+
}
3908+
}
3909+
3910+
#[bench]
3911+
fn bench_connect(bh: &mut BenchHarness) {
3912+
let s = "ศไทย中华Việt Nam; Mary had a little lamb, Little lamb";
3913+
let sep = "→";
3914+
let v = [s, s, s, s, s, s, s, s, s, s];
3915+
do bh.iter {
3916+
assert_eq!(v.connect(sep).len(), s.len() * 10 + sep.len() * 9);
3917+
}
3918+
}
39003919
}

0 commit comments

Comments
 (0)