dbertoni    01/01/16 12:48:19

  Modified:    c/src/XSLT NodeSorter.cpp NodeSorter.hpp
  Log:
  Changed return a reference to a string instead of a copy.
  
  Revision  Changes    Path
  1.17      +7 -4      xml-xalan/c/src/XSLT/NodeSorter.cpp
  
  Index: NodeSorter.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/NodeSorter.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- NodeSorter.cpp    2000/11/21 21:10:17     1.16
  +++ NodeSorter.cpp    2001/01/16 20:48:18     1.17
  @@ -317,7 +317,7 @@
   
   
   
  -const XalanDOMString
  +const XalanDOMString&
   NodeSorter::NodeSortKeyCompare::getStringResult(
                                const NodeSortKey&      theKey,
                                XalanNode*                      node) const
  @@ -348,11 +348,14 @@
   
        const XalanDOMString&   theResult = result->str();
   
  +     XalanDOMString&         theString =
   #if defined(XALAN_NO_MUTABLE)
  -     ((NodeSortKeyCompare*)this)->m_stringResultsCache[xpath][node] = 
theResult;
  +             ((NodeSortKeyCompare*)this)->m_stringResultsCache[xpath][node];
   #else
  -     m_stringResultsCache[xpath][node] = theResult;
  +             m_stringResultsCache[xpath][node];
   #endif
   
  -     return theResult;
  +     assign(theString, theResult);
  +
  +     return theString;
   }
  
  
  
  1.10      +4 -4      xml-xalan/c/src/XSLT/NodeSorter.hpp
  
  Index: NodeSorter.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/NodeSorter.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- NodeSorter.hpp    2000/08/07 19:52:05     1.9
  +++ NodeSorter.hpp    2001/01/16 20:48:18     1.10
  @@ -186,7 +186,7 @@
                                const NodeSortKey&      theKey,
                                XalanNode*                      node) const;
   
  -             const XalanDOMString
  +             const XalanDOMString&
                getStringResult(
                                const NodeSortKey&      theKey,
                                XalanNode*                      node) const;
  @@ -205,15 +205,15 @@
   
                typedef map<const XalanNode*,
                                    XalanDOMString,
  -                                     less<const XalanNode*> >                
StringResultsNodeCacheMapType;
  +                                     less<const XalanNode*> >        
StringResultsNodeCacheMapType;
   
                typedef map<const XPath*,
                                        NumberResultsNodeCacheMapType,
  -                                     less<const XPath*> >    
NumberResultsCacheMapType;
  +                                     less<const XPath*> >            
NumberResultsCacheMapType;
   
                typedef map<const XPath*,
                                        StringResultsNodeCacheMapType,
  -                                     less<const XPath*> >    
StringResultsCacheMapType;
  +                                     less<const XPath*> >            
StringResultsCacheMapType;
   #else
                typedef std::map<const XalanNode*, double>                      
NumberResultsNodeCacheMapType;
                typedef std::map<const XalanNode*, XalanDOMString>      
StringResultsNodeCacheMapType;
  
  
  

Reply via email to