dbertoni    02/05/05 22:13:33

  Modified:    c/src/DOMSupport DOMServices.cpp
  Log:
  More efficient implementation.
  
  Revision  Changes    Path
  1.37      +9 -17     xml-xalan/c/src/DOMSupport/DOMServices.cpp
  
  Index: DOMServices.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/DOMSupport/DOMServices.cpp,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- DOMServices.cpp   12 Apr 2002 04:45:03 -0000      1.36
  +++ DOMServices.cpp   6 May 2002 05:13:33 -0000       1.37
  @@ -792,25 +792,17 @@
   
                                        const XalanDOMString&   aname = 
attr->getNodeName();
   
  -                                     const XalanDOMString::size_type         len = 
length(aname);
  -
  -                                     const bool isPrefix = len <= 
s_XMLNamespaceWithSeparatorLength ? false :
  -                                                     equals(substring(aname,
  -                                                                                    
  0,
  -                                                                                    
  s_XMLNamespaceWithSeparatorLength),
  -                                                                
s_XMLNamespaceWithSeparator);
  -
  -                                     if (equals(aname, s_XMLNamespace) || isPrefix) 
  +                                     if (equals(aname, s_XMLNamespace) == true)
                                        {
  -                                             // slightly inefficient for default 
decl.
  -                                             const XalanDOMString::size_type        
 index =
  -                                                     indexOf(aname, 
XalanUnicode::charColon);
  +                                             theNamespace = &attr->getNodeValue();
   
  -                                             const XalanDOMString    p = isPrefix ?
  -                                                     substring(aname,index + 1,len) 
  -                                                     : XalanDOMString();
  -
  -                                             if (equals(p, prefix) == true)
  +                                             break;
  +                                     }
  +                                     else if (startsWith(aname, 
s_XMLNamespaceWithSeparator) == true) 
  +                                     {
  +                                             if (equals(
  +                                                             prefix,
  +                                                             c_wstr(aname) + 
s_XMLNamespaceWithSeparatorLength) == true)
                                                {
                                                        theNamespace = 
&attr->getNodeValue();
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to