aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2011-12-06 20:07:29 -0500
committerDave Methvin <dave.methvin@gmail.com>2011-12-06 20:07:29 -0500
commit2c75a993be712ceb5da4eee9810f562b90fd7e23 (patch)
tree8e1802bcead3d3837d7837920aa743f380c22e5a
parent6aa4095ed62e3e37dae4c39c00fb627a3b282307 (diff)
downloadjquery-2c75a993be712ceb5da4eee9810f562b90fd7e23.tar.gz
jquery-2c75a993be712ceb5da4eee9810f562b90fd7e23.zip
Precompute the parts array; clean up a JSLint complaint.
Followup to 6c2a501de40a5f6b3ad382e2d309e5a10fce04d0 for bug #5571.
-rw-r--r--src/data.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/data.js b/src/data.js
index 43b8b7b5d..26bef32af 100644
--- a/src/data.js
+++ b/src/data.js
@@ -281,10 +281,11 @@ jQuery.fn.extend({
});
}
+ parts = key.split( ".", 2 );
+ parts[1] = parts[1] ? "." + parts[1] : "";
+ part = parts[1] + "!";
+
return jQuery.access( this, function( value ) {
- parts = key.split( ".", 2 ),
- parts[1] = parts[1] ? "." + parts[1] : "";
- part = parts[1] + "!";
if ( value === undefined ) {
data = this.triggerHandler( "getData" + part, [ parts[0] ] );