pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1803844 - /pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java
Date Wed, 02 Aug 2017 16:04:43 GMT
Author: tilman
Date: Wed Aug  2 16:04:42 2017
New Revision: 1803844

URL: http://svn.apache.org/viewvc?rev=1803844&view=rev
Log:
PDFBOX-2852: remove unneeded nullcheck

Modified:
    pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java

Modified: pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java?rev=1803844&r1=1803843&r2=1803844&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java (original)
+++ pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java Wed
Aug  2 16:04:42 2017
@@ -451,6 +451,7 @@ public final class TTFSubsetter
         return bos.toByteArray();
     }
 
+    // never returns null
     private byte[] buildLocaTable(long[] newOffsets) throws IOException
     {
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -553,9 +554,11 @@ public final class TTFSubsetter
                 glyphIds.addAll(glyphIdsToAdd);
             }
             hasNested = glyphIdsToAdd != null;
-        } while (hasNested);
+        }
+        while (hasNested);
     }
 
+    // never returns null
     private byte[] buildGlyfTable(long[] newOffsets) throws IOException
     {
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
@@ -984,17 +987,11 @@ public final class TTFSubsetter
             {
                 tables.put("cmap", cmap);
             }
-            if (glyf != null)
-            {
-                tables.put("glyf", glyf); 
-            }
+            tables.put("glyf", glyf); 
             tables.put("head", head);
             tables.put("hhea", hhea);
             tables.put("hmtx", hmtx);
-            if (loca != null)
-            {
-                tables.put("loca", loca);
-            }
+            tables.put("loca", loca);
             tables.put("maxp", maxp);
             if (name != null)
             {



Mime
View raw message