From 138bce2554e47deafb5883a1ae4502778db2d54b Mon Sep 17 00:00:00 2001 From: Arne Kiesewetter Date: Fri, 24 Apr 2015 12:41:39 +0200 Subject: [PATCH] Remove unnecessary assignment/checks from Color32 Former-commit-id: 8ede1ef15fbaea53112f7dd0a317e38e1f548d62 Former-commit-id: 8594245f2de90befc507ce4c7e704978e105069e Former-commit-id: bf6409e5f6a8c095fa14f1f1560846647f5bbac7 --- src/ImageProcessor/Imaging/Colors/Color32.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ImageProcessor/Imaging/Colors/Color32.cs b/src/ImageProcessor/Imaging/Colors/Color32.cs index 8e919eefb..127fe7811 100644 --- a/src/ImageProcessor/Imaging/Colors/Color32.cs +++ b/src/ImageProcessor/Imaging/Colors/Color32.cs @@ -76,9 +76,6 @@ namespace ImageProcessor.Imaging.Colors this.R = red; this.G = green; this.B = blue; - - // Stolen from Color. - this.Argb = (int)(((uint)((((red << 0x10) | (green << 8)) | blue) | (alpha << 0x18))) & 0xffffffffL); } /// @@ -114,7 +111,7 @@ namespace ImageProcessor.Imaging.Colors { Color32 color32 = (Color32)obj; - return this.B == color32.B && this.G == color32.G & this.R == color32.R & this.A == color32.A; + return this.Argb == color32.Argb; } return false; @@ -152,4 +149,4 @@ namespace ImageProcessor.Imaging.Colors } } } -} +} \ No newline at end of file