You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by GitBox <gi...@apache.org> on 2021/08/22 20:32:50 UTC

[GitHub] [pdfbox] PascalSchumacher commented on a change in pull request #107: potential memory leaks and small performance improvements

PascalSchumacher commented on a change in pull request #107:
URL: https://github.com/apache/pdfbox/pull/107#discussion_r693553270



##########
File path: fontbox/src/main/java/org/apache/fontbox/ttf/CmapTable.java
##########
@@ -81,9 +81,10 @@ void read(TrueTypeFont ttf, TTFDataStream data) throws IOException
             cmap.initData(data);
             cmaps[i] = cmap;
         }
+        int numberOfGlyphs = ttf.getNumberOfGlyphs();

Review comment:
       I think the JVM is able to optimize this by using `hoisting` (see e.g.: https://advancedweb.hu/jvm-jit-optimization-techniques-part-2/). Imho there is no need to do it by hand and increases the lines of code.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org