iliaa           Wed Mar 22 17:32:21 2006 UTC

  Modified files:              
    /php-src/ext/pgsql  pgsql.c 
  Log:
  Simplify and optimize code.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/pgsql/pgsql.c?r1=1.345&r2=1.346&diff_format=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.345 php-src/ext/pgsql/pgsql.c:1.346
--- php-src/ext/pgsql/pgsql.c:1.345     Thu Mar 16 14:58:56 2006
+++ php-src/ext/pgsql/pgsql.c   Wed Mar 22 17:32:21 2006
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: pgsql.c,v 1.345 2006/03/16 14:58:56 edink Exp $ */
+/* $Id: pgsql.c,v 1.346 2006/03/22 17:32:21 iliaa Exp $ */
 
 #include <stdlib.h>
 
@@ -2672,16 +2672,15 @@
           (Jouni)
        */
 
-       if (strchr(mode_string, 'r') == mode_string) {
+       if (mode_string[0] == 'r') {
                pgsql_mode |= INV_READ;
-               if (strchr(mode_string, '+') == mode_string+1) {
+               if (mode_string[1] == '+') {
                        pgsql_mode |= INV_WRITE;
                }
-       }
-       if (strchr(mode_string, 'w') == mode_string) {
+       } else if (mode_string[0] == 'w') {
                pgsql_mode |= INV_WRITE;
                create = 1;
-               if (strchr(mode_string, '+') == mode_string+1) {
+               if (mode_string[1] == '+') {
                        pgsql_mode |= INV_READ;
                }
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to