mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Remove some useless clone() call on SpecifiedUrl::image_value.
This commit is contained in:
parent
72d09202f4
commit
14b708311b
3 changed files with 6 additions and 6 deletions
|
@ -155,12 +155,12 @@ impl nsStyleImage {
|
|||
},
|
||||
GenericImage::Url(ref url) => {
|
||||
unsafe {
|
||||
Gecko_SetLayerImageImageValue(self, url.image_value.clone().unwrap().get());
|
||||
Gecko_SetLayerImageImageValue(self, url.image_value.as_ref().unwrap().get());
|
||||
}
|
||||
},
|
||||
GenericImage::Rect(ref image_rect) => {
|
||||
unsafe {
|
||||
Gecko_SetLayerImageImageValue(self, image_rect.url.image_value.clone().unwrap().get());
|
||||
Gecko_SetLayerImageImageValue(self, image_rect.url.image_value.as_ref().unwrap().get());
|
||||
Gecko_InitializeImageCropRect(self);
|
||||
|
||||
// Set CropRect
|
||||
|
|
|
@ -150,7 +150,7 @@ impl MallocSizeOf for SpecifiedUrl {
|
|||
// Although this is a RefPtr, this is the primary reference because
|
||||
// SpecifiedUrl is responsible for creating the image_value. So we
|
||||
// measure unconditionally here.
|
||||
n += unsafe { Gecko_ImageValue_SizeOfIncludingThis(image_value.clone().get()) };
|
||||
n += unsafe { Gecko_ImageValue_SizeOfIncludingThis(image_value.get()) };
|
||||
}
|
||||
|
||||
n
|
||||
|
|
|
@ -4073,7 +4073,7 @@ fn static_assert() {
|
|||
longhands::list_style_image::computed_value::T(Either::First(ref url)) => {
|
||||
unsafe {
|
||||
Gecko_SetListStyleImageImageValue(&mut self.gecko,
|
||||
url.image_value.clone().unwrap().get());
|
||||
url.image_value.as_ref().unwrap().get());
|
||||
}
|
||||
// We don't need to record this struct as uncacheable, like when setting
|
||||
// background-image to a url() value, since only properties in reset structs
|
||||
|
@ -5291,7 +5291,7 @@ clip-path
|
|||
for i in 0..v.images.len() {
|
||||
unsafe {
|
||||
Gecko_SetCursorImageValue(&mut self.gecko.mCursorImages[i],
|
||||
v.images[i].url.clone().image_value.unwrap().get());
|
||||
v.images[i].url.image_value.as_ref().unwrap().get());
|
||||
}
|
||||
|
||||
// We don't need to record this struct as uncacheable, like when setting
|
||||
|
@ -5551,7 +5551,7 @@ clip-path
|
|||
ContentItem::Url(ref url) => {
|
||||
unsafe {
|
||||
bindings::Gecko_SetContentDataImageValue(&mut self.gecko.mContents[i],
|
||||
url.image_value.clone().unwrap().get())
|
||||
url.image_value.as_ref().unwrap().get())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue