Commit eb88149
committed
Coding Standards: Use
Several places in core use `array_search()` purely to determine whether a value exists in an array, comparing the result against `false`. In these cases the returned key/position is never used, so `in_array()` expresses the intent more clearly and avoids computing a return value that is discarded.
This commit replaces those existence-only `array_search()` calls with `in_array()`. The strict (`true`) comparison flag is preserved in every case, so there is no change in behavior.
Props Soean.
See #64897.
git-svn-id: https://develop.svn.wordpress.org/trunk@62699 602fd350-edb4-49c9-b593-d223f7449a82in_array() instead of array_search() for existence checks.1 parent 6d91e38 commit eb88149
4 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1179 | 1179 | | |
1180 | 1180 | | |
1181 | 1181 | | |
1182 | | - | |
| 1182 | + | |
1183 | 1183 | | |
1184 | 1184 | | |
1185 | 1185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1863 | 1863 | | |
1864 | 1864 | | |
1865 | 1865 | | |
1866 | | - | |
| 1866 | + | |
1867 | 1867 | | |
1868 | 1868 | | |
1869 | 1869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3736 | 3736 | | |
3737 | 3737 | | |
3738 | 3738 | | |
3739 | | - | |
| 3739 | + | |
3740 | 3740 | | |
3741 | 3741 | | |
3742 | 3742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2171 | 2171 | | |
2172 | 2172 | | |
2173 | 2173 | | |
2174 | | - | |
| 2174 | + | |
2175 | 2175 | | |
2176 | 2176 | | |
2177 | 2177 | | |
| |||
0 commit comments