File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -253,10 +253,10 @@ Object.extend(String.prototype, (function() {
253
253
(e.g. background-color -> backgroundColor) so we take advantage of caching
254
254
*/
255
255
256
- var camelizeCache = { } ;
256
+ var camelizeCache = { } , cached ;
257
257
function camelize ( ) {
258
- if ( typeof camelizeCache [ this ] == 'string' ) {
259
- return camelizeCache [ this ] ;
258
+ if ( typeof ( cached = camelizeCache [ this ] ) == 'string' ) {
259
+ return cached ;
260
260
}
261
261
var parts = this . split ( '-' ) , len = parts . length ;
262
262
if ( len == 1 ) return parts [ 0 ] ;
@@ -276,10 +276,10 @@ Object.extend(String.prototype, (function() {
276
276
*
277
277
* Capitalizes the first letter of a string and downcases all the others.
278
278
**/
279
- var capitalizeCache = { } ;
279
+ var capitalizeCache = { } , cached ;
280
280
function capitalize ( ) {
281
- if ( typeof capitalizeCache [ this ] == 'string' ) {
282
- return capitalizeCache [ this ] ;
281
+ if ( typeof ( cached = capitalizeCache [ this ] ) == 'string' ) {
282
+ return cached ;
283
283
}
284
284
return ( capitalizeCache [ this ] = this . charAt ( 0 ) . toUpperCase ( ) + this . substring ( 1 ) . toLowerCase ( ) ) ;
285
285
}
You can’t perform that action at this time.
0 commit comments