Index: third_party/libxslt/libxslt/imports.c |
diff --git a/third_party/libxslt/libxslt/imports.c b/third_party/libxslt/libxslt/imports.c |
index 9277b4f64fd87883df7554e2201bb779780dfb7c..7262aab9541113e6fd854f396d8406a26550794e 100644 |
--- a/third_party/libxslt/libxslt/imports.c |
+++ b/third_party/libxslt/libxslt/imports.c |
@@ -400,17 +400,12 @@ xsltFindTemplate(xsltTransformContextPtr ctxt, const xmlChar *name, |
return(NULL); |
style = ctxt->style; |
while (style != NULL) { |
- cur = style->templates; |
- while (cur != NULL) { |
- if (xmlStrEqual(name, cur->name)) { |
- if (((nameURI == NULL) && (cur->nameURI == NULL)) || |
- ((nameURI != NULL) && (cur->nameURI != NULL) && |
- (xmlStrEqual(nameURI, cur->nameURI)))) { |
- return(cur); |
- } |
- } |
- cur = cur->next; |
- } |
+ if (style->namedTemplates != NULL) { |
+ cur = (xsltTemplatePtr) |
+ xmlHashLookup2(style->namedTemplates, name, nameURI); |
+ if (cur != NULL) |
+ return(cur); |
+ } |
style = xsltNextImport(style); |
} |