Skip to content

Commit c475bea

Browse files
committed
PDFBOX-5660: optimize, as suggested by Valery Bokov; closes #254
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1928492 13f79535-47bb-0310-9956-ffa450edef68
1 parent d332b69 commit c475bea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,11 @@ private FontBoxFont findFont(FontFormat format, String postScriptName)
468468
*/
469469
private FontInfo getFont(FontFormat format, String postScriptName)
470470
{
471+
int index = postScriptName.indexOf('+');
471472
// strip subset tag (happens when we substitute a corrupt embedded font, see PDFBOX-2642)
472-
if (postScriptName.contains("+"))
473+
if (index > -1)
473474
{
474-
postScriptName = postScriptName.substring(postScriptName.indexOf('+') + 1);
475+
postScriptName = postScriptName.substring(index + 1);
475476
}
476477

477478
// look up the PostScript name

0 commit comments

Comments
 (0)