Skip to content

Commit ae467e5

Browse files
committed
Removed vars, whitespace, 2 bytes saved gzip
1 parent b106a0e commit ae467e5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/jquery.cookie.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,20 @@
7575

7676
// Read
7777

78-
var result = key ? undefined : {};
78+
var result = key ? undefined : {},
7979

8080
// To prevent the for loop in the first place assign an empty array
8181
// in case there are no cookies at all. Also prevents odd result when
8282
// calling $.cookie().
83-
var cookies = document.cookie ? document.cookie.split('; ') : [];
83+
cookies = document.cookie ? document.cookie.split('; ') : [],
84+
i = 0, l = cookies.length;
8485

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('=');
8990

90-
if (key && key === name) {
91+
if (key === name) {
9192
// If second argument (value) is a function it's a converter...
9293
result = read(cookie, value);
9394
break;

0 commit comments

Comments
 (0)