mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Make quotes property representation allocate less.
Differential Revision: https://phabricator.services.mozilla.com/D10650
This commit is contained in:
parent
56fd3b786f
commit
acf7b65f36
5 changed files with 54 additions and 66 deletions
|
@ -4187,9 +4187,9 @@ fn static_assert() {
|
|||
UniqueRefPtr::from_addrefed(Gecko_NewStyleQuoteValues(other.0.len() as u32))
|
||||
};
|
||||
|
||||
for (servo, gecko) in other.0.into_iter().zip(refptr.mQuotePairs.iter_mut()) {
|
||||
gecko.first.assign_str(&servo.0);
|
||||
gecko.second.assign_str(&servo.1);
|
||||
for (servo, gecko) in other.0.iter().zip(refptr.mQuotePairs.iter_mut()) {
|
||||
gecko.first.assign_str(&servo.opening);
|
||||
gecko.second.assign_str(&servo.closing);
|
||||
}
|
||||
|
||||
self.gecko.mQuotes.set_move(refptr.get())
|
||||
|
@ -4206,14 +4206,14 @@ fn static_assert() {
|
|||
pub fn clone_quotes(&self) -> longhands::quotes::computed_value::T {
|
||||
unsafe {
|
||||
let ref gecko_quote_values = *self.gecko.mQuotes.mRawPtr;
|
||||
longhands::quotes::computed_value::T(
|
||||
longhands::quotes::computed_value::T(Arc::new(
|
||||
gecko_quote_values.mQuotePairs.iter().map(|gecko_pair| {
|
||||
(
|
||||
gecko_pair.first.to_string().into_boxed_str(),
|
||||
gecko_pair.second.to_string().into_boxed_str(),
|
||||
)
|
||||
values::specified::QuotePair {
|
||||
opening: gecko_pair.first.to_string().into_boxed_str(),
|
||||
closing: gecko_pair.second.to_string().into_boxed_str(),
|
||||
}
|
||||
}).collect::<Vec<_>>().into_boxed_slice()
|
||||
)
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue