From 6348f9436242ef4d89a8db5b1f1d27ada43c0af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 19 May 2011 20:54:52 +0100 Subject: [PATCH] Optimise Gradient constructor. --- src/color/Gradient.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/color/Gradient.js b/src/color/Gradient.js index c4475aae..1a0c8aeb 100644 --- a/src/color/Gradient.js +++ b/src/color/Gradient.js @@ -20,12 +20,8 @@ var Gradient = this.Gradient = Base.extend({ // TODO: should type here be called 'radial' and have it // receive a boolean value? initialize: function(stops, type) { - if (!stops) { - stops = [new GradientStop('white', 0), - new GradientStop('black', 1)]; - } - this.setStops(stops); - this.type = type ? type : 'linear'; + this.setStops(stops || ['white', 'black']); + this.type = type || 'linear'; }, getStops: function() {