From 5a0867d1e94794fbfc3be1f18f4c0a168dc18d95 Mon Sep 17 00:00:00 2001 From: Shivaji Varma Date: Wed, 12 Nov 2014 15:59:41 +0530 Subject: [PATCH] Ajax: simplify jQuery.parseXML method -2 bytes to the gzipped size and code looks a bit nicer This wasn't landed to the compat branch though, since size would increase with this cherry-pick Closes gh-1856 --- src/ajax/parseXML.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ajax/parseXML.js b/src/ajax/parseXML.js index 9eeb625ff..6a40c854a 100644 --- a/src/ajax/parseXML.js +++ b/src/ajax/parseXML.js @@ -4,15 +4,14 @@ define([ // Cross-browser xml parsing jQuery.parseXML = function( data ) { - var xml, tmp; + var xml; if ( !data || typeof data !== "string" ) { return null; } // Support: IE9 try { - tmp = new DOMParser(); - xml = tmp.parseFromString( data, "text/xml" ); + xml = ( new DOMParser() ).parseFromString( data, "text/xml" ); } catch ( e ) { xml = undefined; }