Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3200

Performance improvement in PDPageContentStream.setFont

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: PDModel
    • Labels:
    • Environment:
      RC3

      Description

      Small performance improvement. Instead of

              if (font.willBeSubset() && !document.getFontsToSubset().contains(font))
              {
                  document.getFontsToSubset().add(font);
              }
      

      I suggest to replace it with

              if (font.willBeSubset())
              {
                  document.getFontsToSubset().add(font);
              }
      

      since the effort for "Set.add" and "Set.contains" are very similar

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              phax Philip Helger
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: