summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-07-06 14:58:22 -0700
committerMichael Howell <michael@notriddle.com>2022-07-06 14:58:22 -0700
commitb47777e6e86824b586706e56393070dcbe85042e (patch)
tree447ba6108cac18f70b247981b2ada130e7b7396e
parentd2c2e539985582e7a06011b4495aa47ebf38747c (diff)
downloadlibrsvg-b47777e6e86824b586706e56393070dcbe85042e.tar.gz
Assume that attributes are normally going to be valid
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/712>
-rw-r--r--src/xml/attributes.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xml/attributes.rs b/src/xml/attributes.rs
index c2c5ac62..4ac7d618 100644
--- a/src/xml/attributes.rs
+++ b/src/xml/attributes.rs
@@ -51,7 +51,7 @@ impl Attributes {
n_attributes: usize,
attrs: *const *const libc::c_char,
) -> Attributes {
- let mut array = Vec::new();
+ let mut array = Vec::with_capacity(n_attributes);
if n_attributes > 0 && !attrs.is_null() {
for attr in slice::from_raw_parts(attrs, n_attributes * 5).chunks_exact(5) {