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

[Enhancement]Optimize some codestyles and fix some warnings #8274

Closed
1 task done
Mrhorse99 opened this issue Jun 9, 2024 · 0 comments · Fixed by #8275
Closed
1 task done

[Enhancement]Optimize some codestyles and fix some warnings #8274

Mrhorse99 opened this issue Jun 9, 2024 · 0 comments · Fixed by #8275

Comments

@Mrhorse99
Copy link
Contributor

Before Creating the Enhancement Request

  • I have confirmed that this should be classified as an enhancement rather than a bug/feature.

Summary

The issue include some optimization for the code style and simplify some code.

Motivation

It make some changes to optimize the code a bit.

Describe the Solution You'd Like

The main optimizations are threefold:
Simplify the code:
image
image

Use the forEach function to replace the stream method in order to avoid the price on creating and destroying the stream object:
image

fix the potential npe problem:
if somwhere doesn't check the file as a directory , the files may be null and the length function may cause the npe problem.
image

Describe Alternatives You've Considered

The code may be enough for the optimization

Additional Context

No response

@Mrhorse99 Mrhorse99 changed the title Optimize some codestyles and fix some warnings [Enhancement]Optimize some codestyles and fix some warnings Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant