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:
@@ -290,9 +290,9 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
|
|||||||
*/
|
*/
|
||||||
getChildValue: function(node, def) {
|
getChildValue: function(node, def) {
|
||||||
var value;
|
var value;
|
||||||
try {
|
if (node && node.firstChild && node.firstChild.nodeValue) {
|
||||||
value = node.firstChild.nodeValue;
|
value = node.firstChild.nodeValue;
|
||||||
} catch(e) {
|
} else {
|
||||||
value = (def != undefined) ? def : "";
|
value = (def != undefined) ? def : "";
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
Reference in New Issue
Block a user