summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2011-02-23 14:14:19 (GMT)
committerDaniel Veillard <veillard@redhat.com>2011-02-23 14:14:19 (GMT)
commit111d705c282e03e7202723c6c7e4499f8582bd4f (patch)
tree3df2a1e169fbf446bde935a9b169ed26e4774e0b
parentc794eb5bb0a6c4f3d213015fa26a11e1e46a3626 (diff)
downloadlibxml2-111d705c282e03e7202723c6c7e4499f8582bd4f.tar.gz
libxml2-111d705c282e03e7202723c6c7e4499f8582bd4f.tar.xz
__xmlRaiseError: do cheap code check early
if error code is XML_ERR_OK return immediately
-rw-r--r--error.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/error.c b/error.c
index 7508d41..34472eb 100644
--- a/error.c
+++ b/error.c
@@ -452,6 +452,8 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
xmlErrorPtr to = &xmlLastError;
xmlNodePtr baseptr = NULL;
+ if (code == XML_ERR_OK)
+ return;
if ((xmlGetWarningsDefaultValue == 0) && (level == XML_ERR_WARNING))
return;
if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) ||
@@ -481,8 +483,6 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
(ctxt->sax->initialized == XML_SAX2_MAGIC))
schannel = ctxt->sax->serror;
}
- if (code == XML_ERR_OK)
- return;
/*
* Formatting the message
*/