Skip to content

Commit d2e8fbb

Browse files
committed
Now using .charAt instead of using strings as arrays. #45
1 parent 11c53de commit d2e8fbb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ module.exports = function(css, options){
128128
var rules = [];
129129
whitespace();
130130
comments(rules);
131-
while (css[0] != '}' && (node = atrule() || rule())) {
131+
while (css.charAt(0) != '}' && (node = atrule() || rule())) {
132132
rules.push(node);
133133
comments(rules);
134134
}
@@ -173,10 +173,10 @@ module.exports = function(css, options){
173173

174174
function comment() {
175175
var pos = position();
176-
if ('/' != css[0] || '*' != css[1]) return;
176+
if ('/' != css.charAt(0) || '*' != css.charAt(1)) return;
177177

178178
var i = 2;
179-
while (null != css[i] && ('*' != css[i] || '/' != css[i + 1])) ++i;
179+
while (null != css.charAt(i) && ('*' != css.charAt(i) || '/' != css.charAt(i + 1))) ++i;
180180
i += 2;
181181

182182
var str = css.slice(2, i - 2);

0 commit comments

Comments
 (0)