File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 75
75
76
76
// Read
77
77
78
- var result = key ? undefined : { } ;
78
+ var result = key ? undefined : { } ,
79
79
80
80
// To prevent the for loop in the first place assign an empty array
81
81
// in case there are no cookies at all. Also prevents odd result when
82
82
// calling $.cookie().
83
- var cookies = document . cookie ? document . cookie . split ( '; ' ) : [ ] ;
83
+ cookies = document . cookie ? document . cookie . split ( '; ' ) : [ ] ,
84
+ i = 0 , l = cookies . length ;
84
85
85
- for ( var i = 0 , l = cookies . length ; i < l ; i ++ ) {
86
- var parts = cookies [ i ] . split ( '=' ) ;
87
- var name = decode ( parts . shift ( ) ) ;
88
- var cookie = parts . join ( '=' ) ;
86
+ for ( ; i < l ; i ++ ) {
87
+ var parts = cookies [ i ] . split ( '=' ) ,
88
+ name = decode ( parts . shift ( ) ) ,
89
+ cookie = parts . join ( '=' ) ;
89
90
90
- if ( key && key === name ) {
91
+ if ( key === name ) {
91
92
// If second argument (value) is a function it's a converter...
92
93
result = read ( cookie , value ) ;
93
94
break ;
You can’t perform that action at this time.
0 commit comments