diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2011-12-06 20:07:29 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-12-06 20:07:29 -0500 |
commit | 2c75a993be712ceb5da4eee9810f562b90fd7e23 (patch) | |
tree | 8e1802bcead3d3837d7837920aa743f380c22e5a | |
parent | 6aa4095ed62e3e37dae4c39c00fb627a3b282307 (diff) | |
download | jquery-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.js | 7 |
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] ] ); |