Move cached hasOwnProperty to the top level.

pull/1/head
David Schnur 13 years ago
parent 73baa2b9e3
commit ff0e5c1b1a

@ -40,6 +40,10 @@ Licensed under the MIT license.
$("head").prepend("<style id='flot-default-styles'>.flot-tick-label {font-size:smaller;color:#545454;}</style>"); $("head").prepend("<style id='flot-default-styles'>.flot-tick-label {font-size:smaller;color:#545454;}</style>");
}); });
// Cache the prototype hasOwnProperty for faster access
var hasOwnProperty = Object.prototype.hasOwnProperty;
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// The Canvas object is a wrapper around an HTML5 <canvas> tag. // The Canvas object is a wrapper around an HTML5 <canvas> tag.
// //
@ -190,8 +194,7 @@ Licensed under the MIT license.
// Check whether the cache actually has any entries. // Check whether the cache actually has any entries.
var hasOwnProperty = Object.prototype.hasOwnProperty, var cacheHasText = false;
cacheHasText = false;
for (var key in cache) { for (var key in cache) {
if (hasOwnProperty.call(cache, key)) { if (hasOwnProperty.call(cache, key)) {

Loading…
Cancel
Save