mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
parser: Use hash tables to avoid quadratic behavior
Use a hash table to lookup namespaces by prefix. The hash table stores an index into the namespace table. Auxiliary data for namespaces is stored in a separate array along the main namespace table. Use a hash table to verify attribute uniqueness. The hash table stores an index into the attribute table. Reuse hash value from the dictionary to avoid computing them twice. See #346.
This commit is contained in:
@@ -49,4 +49,16 @@ xmlDetectEncoding(xmlParserCtxtPtr ctxt);
|
||||
XML_HIDDEN void
|
||||
xmlSetDeclaredEncoding(xmlParserCtxtPtr ctxt, xmlChar *encoding);
|
||||
|
||||
/*
|
||||
* These functions allow SAX handlers to attach extra data to namespaces
|
||||
* efficiently and should be made public.
|
||||
*/
|
||||
void
|
||||
xmlParserNsFree(xmlParserNsData *nsdb);
|
||||
XML_HIDDEN int
|
||||
xmlParserNsUpdateSax(xmlParserCtxtPtr ctxt, const xmlChar *prefix,
|
||||
void *saxData);
|
||||
XML_HIDDEN void *
|
||||
xmlParserNsLookupSax(xmlParserCtxtPtr ctxt, const xmlChar *prefix);
|
||||
|
||||
#endif /* XML_PARSER_H_PRIVATE__ */
|
||||
|
||||
Reference in New Issue
Block a user