Skip to content
This repository has been archived by the owner. It is now read-only.

Implementing equality operator for AzColor and Color objects. #140

Merged
merged 2 commits into from Jan 30, 2015

Conversation

@Adenilson
Copy link
Contributor

Adenilson commented Jan 30, 2015

This should easy the use of AzColor by servo (e.g. layout_task.rs).

#[inline]
impl PartialEq for AzColor {
fn eq(&self, other: &AzColor) -> bool {
if self.r != other.r || self.g != other.g || self.b != other.b || self.a != other.a {

This comment has been minimized.

@mrobinson

mrobinson Jan 30, 2015

Member

Why not just do:

self.r == other.r && self.g == other.g...

and skip the conditional block?

This comment has been minimized.

@Adenilson

Adenilson Jan 30, 2015

Author Contributor

Yeah, it makes sense and the code will be cleaner. Let me update it.

@@ -125,6 +125,16 @@ impl Color {
}
}

#[inline]
impl PartialEq for Color {

This comment has been minimized.

@mrobinson

mrobinson Jan 30, 2015

Member

Same comment here. :)

This comment has been minimized.

@Adenilson

Adenilson Jan 30, 2015

Author Contributor

Ok, done.

@mrobinson
Copy link
Member

mrobinson commented Jan 30, 2015

Looks good to me!

mrobinson added a commit that referenced this pull request Jan 30, 2015
Implementing equality operator for AzColor and Color objects.
@mrobinson mrobinson merged commit 779233a into servo:master Jan 30, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.