commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1649426 - /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/SimplePalette.java
Date Sun, 04 Jan 2015 21:19:55 GMT
Author: britter
Date: Sun Jan  4 21:19:54 2015
New Revision: 1649426

URL: http://svn.apache.org/r1649426
Log:
Inline method

Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/SimplePalette.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/SimplePalette.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/SimplePalette.java?rev=1649426&r1=1649425&r2=1649426&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/SimplePalette.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/palette/SimplePalette.java
Sun Jan  4 21:19:54 2015
@@ -24,16 +24,8 @@ public class SimplePalette implements Pa
     }
 
     public int getPaletteIndex(final int rgb) {
-        return getPaletteIndex(palette, rgb);
-    }
-
-    public int getEntry(final int index) {
-        return palette[index];
-    }
-
-    private int getPaletteIndex(final int[] palette, final int argb) {
         for (int i = 0; i < palette.length; i++) {
-            if (palette[i] == argb) {
+            if (palette[i] == rgb) {
                 return i;
             }
         }
@@ -41,6 +33,10 @@ public class SimplePalette implements Pa
         return -1;
     }
 
+    public int getEntry(final int index) {
+        return palette[index];
+    }
+
     public int length() {
         return palette.length;
     }



Mime
View raw message