-
Notifications
You must be signed in to change notification settings - Fork 55
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
small refactoring of findOne func #119
Conversation
SkobelkinYaroslav
commented
Mar 24, 2024
- combined two if statements into one: made quick research, since we use filepath.WalkDir, there is no need in returning fs.SkipDir value
- removed strings.TrimPrefix. Under the hood it makes additional check, if string has pefix. Since we sure, that we always get file extension with dot, we don't need this check
…elds because of optimization (arrays were used only to check the occurrence of an element)
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.
Nice job. LGTM.
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.
LGTM - did some local functional testing with different values for depth and exclude-dirs and everything looked good.
Thank you @SkobelkinYaroslav for another great PR! |
* changed []string to map[string]struct{} in FileSystemFinder struct fields because of optimization (arrays were used only to check the occurrence of an element) * Changed field Extensions type in FileType from []string to map[string]struct{} * added requested changes * small refactoring of findOne func * fixd the return value * get back to trimprefix func * cleanup --------- Co-authored-by: Yaroslav <=>