diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2013-11-11 13:13:22 -0500 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2015-03-04 17:26:47 -0500 |
commit | d702b7637a61e1973e08c27b8d8de2ed24a543e2 (patch) | |
tree | 5facc46a8a1fd855112e851219c6efc1b2206eb3 /src/event.js | |
parent | 95fb798980d7e404c413e29e20016db9052e2bf2 (diff) | |
download | jquery-d702b7637a61e1973e08c27b8d8de2ed24a543e2.tar.gz jquery-d702b7637a61e1973e08c27b8d8de2ed24a543e2.zip |
Data: move element cache to element[expando]
- avoid explicit data.discard() cleanup calls
- explicitly remove the data.events property, only when private data exists
- reduces code footprint
Fixes gh-1734
Close gh-1428
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/event.js b/src/event.js index ae0539bb9..4849ef3f0 100644 --- a/src/event.js +++ b/src/event.js @@ -216,8 +216,12 @@ jQuery.event = { // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { + // Normally this should go through the data api + // but since event.js owns these properties, + // this exception is made for the sake of optimizing + // the operation. delete elemData.handle; - dataPriv.remove( elem, "events" ); + delete elemData.events; } }, |