diff options
author | Michael Howell <michael@notriddle.com> | 2022-07-06 14:58:22 -0700 |
---|---|---|
committer | Michael Howell <michael@notriddle.com> | 2022-07-06 14:58:22 -0700 |
commit | b47777e6e86824b586706e56393070dcbe85042e (patch) | |
tree | 447ba6108cac18f70b247981b2ada130e7b7396e | |
parent | d2c2e539985582e7a06011b4495aa47ebf38747c (diff) | |
download | librsvg-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.rs | 2 |
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) { |