Merge pull request #2886 from elemoine/ternary

Use ternary notation
This commit is contained in:
Éric Lemoine
2014-10-27 17:47:10 +01:00

View File

@@ -105,13 +105,7 @@ goog.exportProperty(
*/
ol.layer.Layer.prototype.getSourceState = function() {
var source = this.getSource();
var state;
if (!goog.isNull(source)) {
state = source.getState();
} else {
state = ol.source.State.UNDEFINED;
}
return state;
return goog.isNull(source) ? ol.source.State.UNDEFINED : source.getState();
};