[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_6-9301-g42f04d4

Michal Čihař nijel at users.sourceforge.net
Mon Aug 30 14:50:43 CEST 2010


The branch, master has been updated
       via  42f04d4a7ece376c57d3c7a717e24bbcc6621425 (commit)
      from  aa4536371980e7c8144505f1a74cff658178fc8c (commit)


- Log -----------------------------------------------------------------
commit 42f04d4a7ece376c57d3c7a717e24bbcc6621425
Author: Michal Čihař <mcihar at novell.com>
Date:   Mon Aug 30 14:49:38 2010 +0200

    Avoid precalculating counts.
    
    The count() on array is cheap in PHP and having hardcoded numbers only
    tends to break.

-----------------------------------------------------------------------

Summary of changes:
 libraries/sqlparser.data.php |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libraries/sqlparser.data.php b/libraries/sqlparser.data.php
index b0b06c2..8f0c140 100644
--- a/libraries/sqlparser.data.php
+++ b/libraries/sqlparser.data.php
@@ -338,7 +338,7 @@ $PMA_SQPdata_function_name = array (
  *
  * @global integer MySQL attributes count
  */
-$PMA_SQPdata_function_name_cnt = 299;
+$PMA_SQPdata_function_name_cnt = count($PMA_SQPdata_function_name);
 
 /*
  * DEBUG
@@ -391,7 +391,7 @@ $PMA_SQPdata_column_attrib = array (
  *
  * @global integer MySQL attributes count
  */
-$PMA_SQPdata_column_attrib_cnt = 30;
+$PMA_SQPdata_column_attrib_cnt = count($PMA_SQPdata_column_attrib);
 
 /**
  * words that are reserved by MySQL and may not be used as identifiers without quotes
@@ -698,7 +698,7 @@ $PMA_SQPdata_reserved_word = array (
  *
  * @global integer MySQL reserved words count
  */
-$PMA_SQPdata_reserved_word_cnt = 289;
+$PMA_SQPdata_reserved_word_cnt = count($PMA_SQPdata_reserved_word);
 /**
  * The previous array must be sorted so that the binary search work.
  * Sometimes a word is not added in the correct order, so
@@ -1213,7 +1213,7 @@ $PMA_SQPdata_forbidden_word = array (
  *
  * @global integer MySQL forbidden words count
  */
-$PMA_SQPdata_forbidden_word_cnt = 483;
+$PMA_SQPdata_forbidden_word_cnt = count($PMA_SQPdata_forbidden_word);
 
 /**
  * the MySQL column/data types
@@ -1284,7 +1284,7 @@ $PMA_SQPdata_column_type = array (
  *
  * @global integer MySQL column types count
  */
-$PMA_SQPdata_column_type_cnt = 54;
+$PMA_SQPdata_column_type_cnt = count($PMA_SQPdata_column_type);
 
 /*
  * check counts


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list