pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1720914 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
Date Sat, 19 Dec 2015 13:29:26 GMT
Author: tilman
Date: Sat Dec 19 13:29:26 2015
New Revision: 1720914

URL: http://svn.apache.org/viewvc?rev=1720914&view=rev
Log:
PDFBOX-2852: combine nested if statements

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java?rev=1720914&r1=1720913&r2=1720914&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java Sat Dec 19
13:29:26 2015
@@ -484,24 +484,21 @@ public class TrueTypeFont implements Fon
 
     private synchronized void readPostScriptNames() throws IOException
     {
-        if (postScriptNames == null)
+        if (postScriptNames == null && getPostScript() != null)
         {
-            if (getPostScript() != null)
+            String[] names = getPostScript().getGlyphNames();
+            if (names != null)
             {
-                String[] names = getPostScript().getGlyphNames();
-                if (names != null)
+                postScriptNames = new HashMap<String, Integer>(names.length);
+                for (int i = 0; i < names.length; i++)
                 {
-                    postScriptNames = new HashMap<String, Integer>(names.length);
-                    for (int i = 0; i < names.length; i++)
-                    {
-                        postScriptNames.put(names[i], i);
-                    }
+                    postScriptNames.put(names[i], i);
                 }
-                else
-                {
-                    postScriptNames = new HashMap<String, Integer>();
-                }                    
             }
+            else
+            {
+                postScriptNames = new HashMap<String, Integer>();
+            }                    
         }
     }
 



Mime
View raw message