]> granicus.if.org Git - php/commitdiff
Simplify and optimize code.
authorIlia Alshanetsky <iliaa@php.net>
Wed, 22 Mar 2006 17:32:21 +0000 (17:32 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 22 Mar 2006 17:32:21 +0000 (17:32 +0000)
ext/pgsql/pgsql.c

index 0ab76f78e3dbf6ab94c91eed081a72af18afe319..9d4aa6b26dd89eec0fb7fa72371dba7bc7ba0e70 100644 (file)
@@ -2672,16 +2672,15 @@ PHP_FUNCTION(pg_lo_open)
           (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;
                }
        }