From a2c01b1090df7a4409677094eb461c665307880f Mon Sep 17 00:00:00 2001 From: Bart van den Eijnden Date: Tue, 25 Feb 2014 19:58:15 +0100 Subject: [PATCH] Get rid of unneccessary if else statements in the GML format --- src/ol/format/gmlformat.js | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/src/ol/format/gmlformat.js b/src/ol/format/gmlformat.js index 5940c5694f..3e12c90cf0 100644 --- a/src/ol/format/gmlformat.js +++ b/src/ol/format/gmlformat.js @@ -372,14 +372,9 @@ ol.format.GML.readLineString_ = function(node, objectStack) { ol.format.GML.readPatch_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT); goog.asserts.assert(node.localName == 'patches'); - var result = ol.xml.pushParseAndPop( + return ol.xml.pushParseAndPop( /** @type {Array.>} */ ([null]), ol.format.GML.PATCHES_PARSERS_, node, objectStack); - if (goog.isDef(result)) { - return result; - } else { - return undefined; - } }; @@ -392,14 +387,9 @@ ol.format.GML.readPatch_ = function(node, objectStack) { ol.format.GML.readSegment_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT); goog.asserts.assert(node.localName == 'segments'); - var result = ol.xml.pushParseAndPop( + return ol.xml.pushParseAndPop( /** @type {Array.} */ ([null]), ol.format.GML.SEGMENTS_PARSERS_, node, objectStack); - if (goog.isDef(result)) { - return result; - } else { - return undefined; - } }; @@ -412,14 +402,9 @@ ol.format.GML.readSegment_ = function(node, objectStack) { ol.format.GML.readPolygonPatch_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT); goog.asserts.assert(node.localName == 'PolygonPatch'); - var result = ol.xml.pushParseAndPop( + return ol.xml.pushParseAndPop( /** @type {Array.>} */ ([null]), ol.format.GML.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack); - if (goog.isDef(result)) { - return result; - } else { - return undefined; - } }; @@ -432,14 +417,9 @@ ol.format.GML.readPolygonPatch_ = function(node, objectStack) { ol.format.GML.readLineStringSegment_ = function(node, objectStack) { goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT); goog.asserts.assert(node.localName == 'LineStringSegment'); - var result = ol.xml.pushParseAndPop( + return ol.xml.pushParseAndPop( /** @type {Array.} */ ([null]), ol.format.GML.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack); - if (goog.isDef(result)) { - return result; - } else { - return undefined; - } };