Skip to content
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

[9.x] Get rid of lots of useless conditions #41198

Merged
merged 1 commit into from
Feb 23, 2022
Merged

[9.x] Get rid of lots of useless conditions #41198

merged 1 commit into from
Feb 23, 2022

Conversation

lucasmichot
Copy link
Contributor

This PR gets rid of lots of useless conditions.

@lucasmichot lucasmichot changed the title [9.x] Get rid of lots of useless conditions. [9.x] Get rid of lots of useless conditions Feb 23, 2022
$files = $from->files->all();

$files = is_array($files) ? array_filter($files) : $files;
$files = array_filter($from->files->all());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$from->files->all() always return an array.

@@ -1942,7 +1942,7 @@ public function originalIsEquivalent($key)
return $this->castAttribute($key, $attribute) ==
$this->castAttribute($key, $original);
} elseif ($this->hasCast($key, ['real', 'float', 'double'])) {
if (($attribute === null && $original !== null) || ($attribute !== null && $original === null)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$attribute has already been evaluated some lines before.

@lucasmichot lucasmichot marked this pull request as draft February 23, 2022 11:36
@lucasmichot lucasmichot marked this pull request as ready for review February 23, 2022 12:14
@taylorotwell taylorotwell merged commit 91c60ea into laravel:9.x Feb 23, 2022
@lucasmichot lucasmichot deleted the useless-conditions branch August 6, 2022 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants