From d702b7637a61e1973e08c27b8d8de2ed24a543e2 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Mon, 11 Nov 2013 13:13:22 -0500 Subject: 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 --- src/event.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/event.js') 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; } }, -- cgit v1.2.3