]> granicus.if.org Git - php/commitdiff
simplify the condition
authorAnatol Belski <ab@php.net>
Sun, 21 Sep 2014 18:54:14 +0000 (20:54 +0200)
committerAnatol Belski <ab@php.net>
Mon, 22 Sep 2014 07:41:53 +0000 (09:41 +0200)
ext/standard/browscap.c

index 9c54aa4897926b6ba55c3ff99bb14afeeab65077..a591a67d4424c586dcf15dfc9c300f5113a3c967 100644 (file)
@@ -414,7 +414,7 @@ static int browser_reg_compare(zval *browser TSRMLS_DC, int num_args, va_list ar
 
                        /* Pick which browser pattern replaces the least amount of
                           characters when compared to the original user agent string... */
-                       if (ua_len - prev_len > ua_len - curr_len) {
+                       if (prev_len < curr_len) {
                                ZVAL_COPY_VALUE(found_browser_entry, browser);
                        }
                }