From 7f35d4fb4d1b63f3b58f1266111de46afc2255db Mon Sep 17 00:00:00 2001 From: Tim Tucker Date: Sun, 30 Sep 2012 11:07:24 -0300 Subject: [PATCH] Update media/src/api/api.static.js Slightly shorter method for checking the version (stops as soon as it reaches a version part that has a difference) --- media/src/api/api.static.js | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/media/src/api/api.static.js b/media/src/api/api.static.js index 5000dce4..18af89d0 100644 --- a/media/src/api/api.static.js +++ b/media/src/api/api.static.js @@ -1,5 +1,4 @@ - /** * Provide a common method for plug-ins to check the version of DataTables being used, in order * to ensure compatibility. @@ -15,25 +14,24 @@ */ DataTable.fnVersionCheck = function( sVersion ) { - /* This is cheap, but effective */ - var fnZPad = function (Zpad, count) - { - while(Zpad.length < count) { - Zpad += '0'; - } - return Zpad; - }; var aThis = DataTable.ext.sVersion.split('.'); var aThat = sVersion.split('.'); - var sThis = '', sThat = ''; + var iThis, sThat; - for ( var i=0, iLen=aThat.length ; i iThat; } - - return parseInt(sThis, 10) >= parseInt(sThat, 10); + return true; };