pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1752979 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type2CharStringParser.java
Date Sat, 16 Jul 2016 14:47:03 GMT
Author: tilman
Date: Sat Jul 16 14:47:02 2016
New Revision: 1752979

URL: http://svn.apache.org/viewvc?rev=1752979&view=rev
Log:
PDFBOX-2852: Avoid using a branching statement as the last in a loop; 

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type2CharStringParser.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type2CharStringParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type2CharStringParser.java?rev=1752979&r1=1752978&r2=1752979&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type2CharStringParser.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type2CharStringParser.java Sat
Jul 16 14:47:02 2016
@@ -121,7 +121,7 @@ public class Type2CharStringParser
             { // process globalsubr command
                 Integer operand=(Integer)sequence.remove(sequence.size()-1);
                 //get subrbias
-                int bias = 0;
+                int bias;
                 int nSubrs = globalSubrIndex.length;
                 
                 if (nSubrs < 1240)
@@ -249,7 +249,7 @@ public class Type2CharStringParser
     private int getMaskLength()
     {
         int hintCount = hstemCount + vstemCount;
-        int length = (int)(hintCount / 8); 
+        int length = hintCount / 8; 
         if (hintCount % 8 > 0)
         {
             length++;
@@ -264,12 +264,11 @@ public class Type2CharStringParser
         {
             Object object = sequence.get(i);
 
-            if (object instanceof Number)
+            if (!(object instanceof Number))
             {
-                numbers.add(0, (Number) object);
-                continue;
+                return numbers;
             }
-            return numbers;
+            numbers.add(0, (Number) object);
         }
         return numbers;
     }



Mime
View raw message