From: Glen Mazza Date: Tue, 13 Jan 2004 23:28:31 +0000 (+0000) Subject: static boolean array inheritableProperty[] added, to reduce processing costs X-Git-Tag: Root_Temp_KnuthStylePageBreaking~916 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3c5e2946bb93e544ce909bb9a91250ea28927a59;p=xmlgraphics-fop.git static boolean array inheritableProperty[] added, to reduce processing costs of lookups to see if a property is inheritable. Work based on Finn Bock's patch. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197158 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/fo/PropertyList.java b/src/java/org/apache/fop/fo/PropertyList.java index 343481ded..b0935d42d 100644 --- a/src/java/org/apache/fop/fo/PropertyList.java +++ b/src/java/org/apache/fop/fo/PropertyList.java @@ -69,6 +69,7 @@ public class PropertyList extends HashMap { // writing-mode values private byte[] wmtable = null; private int writingMode; + private static boolean[] inheritableProperty; // absolute directions and dimensions /** constant for direction "left" */ @@ -678,14 +679,16 @@ public class PropertyList extends HashMap { * @return isInherited value from the requested Property.Maker */ private boolean isInherited(int propId) { - boolean b = true; - - Property.Maker propertyMaker = findMaker(propId); - if (propertyMaker != null) { - b = propertyMaker.isInherited(); + if (inheritableProperty == null) { + inheritableProperty = new boolean[Constants.PROPERTY_COUNT + 1]; + Property.Maker maker = null; + for (int prop = 1; prop <= Constants.PROPERTY_COUNT; prop++) { + maker = findMaker(prop); + inheritableProperty[prop] = (maker != null && maker.isInherited()); + } } - - return b; + + return inheritableProperty[propId]; } /**