Permalink
Browse files

minor improvements

  • Loading branch information...
1 parent 28a9a2b commit 78edc70ba58d7328560bfca34a09e184d04dfc41 Gabriel Llamas committed Dec 17, 2013
Showing with 8 additions and 8 deletions.
  1. +2 −2 lib/parse.js
  2. +3 −3 lib/read.js
  3. +3 −3 lib/stringify.js
View
@@ -55,7 +55,7 @@ module.exports = function (data, options, handlers, control){
var escapeString = function (key, c, code){
if (escapingUnicode && unicodeRemaining){
- unicode = (unicode<<4) + hex (c);
+ unicode = (unicode << 4) + hex (c);
if (--unicodeRemaining) return key;
escape = false;
escapingUnicode = false;
@@ -109,7 +109,7 @@ module.exports = function (data, options, handlers, control){
};
}
- for (var i=~~control.resume, ii=data.length; i<ii; i++){
+ for (var i=~~control.resume; i<data.length; i++){
if (control.abort) return;
if (control.pause){
//The next index is always the start of a new line, it's a like a fresh
View
@@ -29,7 +29,7 @@ var expand = function (o, str, options, cb){
var t;
var n;
- for (var i=0, ii=str.length; i<ii; i++){
+ for (var i=0; i<str.length; i++){
c = str[i];
if (cp === "$" && c === "{"){
@@ -90,7 +90,7 @@ var namespaceValue = function (p, key){
var n = key.split (".");
var str;
- for (var i=0, ii=n.length-1; i<ii; i++){
+ for (var i=0; i<n.length-1; i++){
str = n[i];
if (p[str] === undefined) return;
p = p[str];
@@ -103,7 +103,7 @@ var namespace = function (p, key, value){
var n = key.split (".");
var str;
- for (var i=0, ii=n.length-1; i<ii; i++){
+ for (var i=0; i<n.length-1; i++){
str = n[i];
if (p[str] === undefined){
p[str] = {};
View
@@ -13,7 +13,7 @@ var stringifyComment = function (comment, meta, options){
var code;
var str = options._comment;
- for (var i=0, ii=comment.length; i<ii; i++){
+ for (var i=0; i<comment.length; i++){
c = comment[i];
code = comment.charCodeAt (i);
@@ -36,7 +36,7 @@ var stringifyKey = function (s, meta, options){
var code;
var str = "";
- for (var i=0, ii=s.length; i<ii; i++){
+ for (var i=0; i<s.length; i++){
c = s[i];
code = s.charCodeAt (i);
str += escape (c, code, meta, options);
@@ -50,7 +50,7 @@ var stringifyValue = function (s, meta, options){
var code;
var str = "";
- for (var i=0, ii=s.length; i<ii; i++){
+ for (var i=0; i<s.length; i++){
c = s[i];
code = s.charCodeAt (i);

0 comments on commit 78edc70

Please sign in to comment.