[php-src] PR #21814: use `IS_SLASH` in various places instead of string comparing
| From: | LamentXU123 | Date: | Mon, 20 Apr 2026 04:34:08 +0000 |
| Subject: | [php-src] PR #21814: use `IS_SLASH` in various places instead of string comparing | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-35794@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21814
Author: LamentXU123
we have a defined
IS_SLASH function:
```
#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
```
So to make things more legible we can use this instead of XXX == '\\' || XXX ==
'/'
I search all occasions by this command:
```
rg -n "'/'.*'\\'|'\\'.*'/'|== '/' \|\| .*==
'\\'|!= '/' && .*!= '\\'|== '\\' \|\| .*==
'/'|!= '\\' && .*!= '/'"
```
and manually remove some improper occasions :)