Project

Profile

Help

Revision 6cad6951

Added by Michael Kay about 3 years ago

Fix bug 3986 (string-join() optimization)

View differences:

latest9.8/hej/net/sf/saxon/functions/StringJoin.java
17 17
import net.sf.saxon.om.ZeroOrOne;
18 18
import net.sf.saxon.trans.XPathException;
19 19
import net.sf.saxon.tree.util.FastStringBuffer;
20
import net.sf.saxon.type.BuiltInAtomicType;
20 21
import net.sf.saxon.value.Cardinality;
21 22
import net.sf.saxon.value.StringValue;
22 23

  
......
83 84
        }
84 85
        int card = arguments[0].getCardinality();
85 86
        if (!Cardinality.allowsMany(card)) {
86
            if (Cardinality.allowsZero(card)) {
87
            if (Cardinality.allowsZero(card) || arguments[0].getItemType().getPrimitiveItemType() != BuiltInAtomicType.STRING) {
87 88
                return SystemFunction.makeCall("string", getRetainedStaticContext(), arguments[0]);
88 89
            } else {
89 90
                return arguments[0];

Also available in: Unified diff