Skip to content

Commit 6f65f5f

Browse files
FarSeeingmarkelog
authored andcommitted
Data: shave off a couple of bytes
Closes gh-1931
1 parent 72c4a06 commit 6f65f5f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/data.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
define([
22
"./core",
3-
"./var/rnotwhite",
43
"./core/access",
54
"./data/var/dataPriv",
65
"./data/var/dataUser"
7-
], function( jQuery, rnotwhite, access, dataPriv, dataUser ) {
6+
], function( jQuery, access, dataPriv, dataUser ) {
87

98
// Implementation Summary
109
//
@@ -17,15 +16,15 @@ define([
1716
// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
1817

1918
var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
20-
rmultiDash = /([A-Z])/g;
19+
rmultiDash = /[A-Z]/g;
2120

2221
function dataAttr( elem, key, data ) {
2322
var name;
2423

2524
// If nothing was found internally, try to fetch any
2625
// data from the HTML5 data-* attribute
2726
if ( data === undefined && elem.nodeType === 1 ) {
28-
name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
27+
name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
2928
data = elem.getAttribute( name );
3029

3130
if ( typeof data === "string" ) {

0 commit comments

Comments
 (0)