From 896a0eda896445394701efdb84e1f285a4f21dde Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Mon, 1 Nov 2010 08:57:06 -0700 Subject: [PATCH] Misc refactoring of parseColor() --- lib/canvas.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/canvas.js b/lib/canvas.js index e25e7f8..1bf378e 100644 --- a/lib/canvas.js +++ b/lib/canvas.js @@ -124,7 +124,7 @@ var parseColor = exports.parseColor = function(str){ , 1 ]; // #RRGGBB - } else if ('#' == str.charAt(0) && str.length > 4) { + } else if ('#' == str[0] && str.length > 4) { var captures = /#([a-fA-F\d]{2})([a-fA-F\d]{2})([a-fA-F\d]{2})/.exec(str); if (!captures) return; return cache[str] = [ @@ -134,7 +134,7 @@ var parseColor = exports.parseColor = function(str){ , 1 ]; // #RGB - } else if ('#' == str.charAt(0)) { + } else if ('#' == str[0]) { var captures = /#([a-fA-F\d])([a-fA-F\d])([a-fA-F\d])/.exec(str); if (!captures) return; return cache[str] = [