-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Replace array_search with in_array in lib/ #40462
Conversation
CI failure is unrelated as far as I can tell |
@@ -269,7 +269,7 @@ public function extract(string $dest): bool { | |||
*/ | |||
public function fileExists(string $path): bool { | |||
$files = $this->getFiles(); | |||
if ((array_search($path, $files) !== false) or (array_search($path . '/', $files) !== false)) { | |||
if ((in_array($path, $files)) or (in_array($path . '/', $files))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ((in_array($path, $files)) or (in_array($path . '/', $files))) { | |
if (in_array($path, $files) || in_array($path . '/', $files)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can address that syntax in another PR 👍
Failing samba tests could be related to touching |
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4fd113a
to
ea8f9a7
Compare
Summary
in_array
returnsbool
, therefore the syntax is more compact than the comparison withfalse
forarray_search
.Checklist