aboutsummaryrefslogtreecommitdiffstats
path: root/ports/geckolib
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2017-08-03 12:04:27 -0400
committerJosh Matthews <josh@joshmatthews.net>2017-08-03 12:04:27 -0400
commit886e393511cc0a3c71e3a0605e25716fbdd5fd93 (patch)
tree3f9d7fa3512ee695c95a89dc05ae86c0be0cce17 /ports/geckolib
parente8e43e5b0c75801fdc469fed3658dc551be00214 (diff)
downloadservo-886e393511cc0a3c71e3a0605e25716fbdd5fd93.tar.gz
servo-886e393511cc0a3c71e3a0605e25716fbdd5fd93.zip
Preallocate escaped CSS strings.
Diffstat (limited to 'ports/geckolib')
-rw-r--r--ports/geckolib/error_reporter.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/geckolib/error_reporter.rs b/ports/geckolib/error_reporter.rs
index f13dc340a11..6b10077aa0f 100644
--- a/ports/geckolib/error_reporter.rs
+++ b/ports/geckolib/error_reporter.rs
@@ -77,7 +77,7 @@ fn escape_css_ident(ident: &str) -> String {
return ident.into()
}
- let mut escaped = String::new();
+ let mut escaped = String::with_capacity(ident.len());
// A leading dash does not need to be escaped as long as it is not the
// *only* character in the identifier.