Exceptions in Firefox are slow. (The costs of the lovely exception.stack,

most likely.) Don't depend on exceptions for parsing XML, then: instead, use
an if/else. 3x speed up of WMC parsing in FF. r=ahocevar (Closes #1642) 


git-svn-id: http://svn.openlayers.org/trunk/openlayers@7870 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-08-26 23:11:03 +00:00
parent 75b129191b
commit 319c8f87ef

View File

@@ -290,9 +290,9 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
*/
getChildValue: function(node, def) {
var value;
try {
if (node && node.firstChild && node.firstChild.nodeValue) {
value = node.firstChild.nodeValue;
} catch(e) {
} else {
value = (def != undefined) ? def : "";
}
return value;