2 ms·
Looking at lines 460-521 in the modified file (https://github.com/miguelxpn/php-src/blob/f4b2089b642d504be358b06bbae81fa688d8bf0e/ext/standard/http_fopen_wrappe
by osrec 7y ago
Looking at lines 460-521 in the modified file (https://github.com/miguelxpn/php-src/blob/f4b2089b642d504be358b06bbae81fa688d8bf0e/ext/standard/http_fopen_wrapper.c#L460 https://github.com/miguelxpn/php-src/blob/f4b2089b642d504be3...), is there not a benefit to `break` out of the while loop in the nested if statements?
Otherwise, it looks like it will call strstr() one extra time, even though you may have already determined that the specific header is present.
- miguelxpn 7y agoGood catch! That's indeed the case. Another commit was made where that piece of code was refactored into a function and it returns 1 in case the header is present so strstr isn't being called an extra time in the current code. [1] https://github.com/php/php-src/commit/3d9c02364db62a6d8e27947ffe47dbfaad644efe#diff-e0dff85f21e939e4e2a778bddb8a72d7 https://github.com/php/php-src/commit/3d9c02364db62a6d8e2794...
- osrec 7y agoAh, much cleaner!