[libxml2] __xmlRaiseError: do cheap code check early



commit 111d705c282e03e7202723c6c7e4499f8582bd4f
Author: Dmitry V. Levin <ldv altlinux org>
Date:   Wed Feb 23 22:14:19 2011 +0800

    __xmlRaiseError: do cheap code check early
    
    if error code is XML_ERR_OK return immediately

 error.c |    4 ++--
 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
      */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]