Skip to content

refactor(cache): further condense walkTree#393

Merged
ezolenko merged 1 commit intoezolenko:masterfrom
agilgur5:refactor-cache-walkTree-take-2
Aug 8, 2022
Merged

refactor(cache): further condense walkTree#393
ezolenko merged 1 commit intoezolenko:masterfrom
agilgur5:refactor-cache-walkTree-take-2

Conversation

@agilgur5
Copy link
Copy Markdown
Collaborator

Summary

Condense walkTree further to just 4 LoC

Details

  • forEach returns void, so we can just return it and condense the if a bit

- `forEach` returns `void`, so we can just `return` it and condense the `if` a bit
@agilgur5 agilgur5 added kind: internal Changes only affect the internals, and _not_ the public API or external-facing docs scope: cache Related to the cache labels Jul 22, 2022
@ezolenko
Copy link
Copy Markdown
Owner

ezolenko commented Aug 8, 2022

Feels weird to return void, but I guess TS will warn if return types ever get out of sync 🤷

@ezolenko ezolenko merged commit bbed47e into ezolenko:master Aug 8, 2022
@agilgur5
Copy link
Copy Markdown
Collaborator Author

agilgur5 commented Aug 8, 2022

Yea it's a stylistic thing; I thought it seemed odd in the context of this codebase but I've written code like this in other codebases where it doesn't seem as "out of place".
Changing some of the style in this and #402 should make it feel more comfortable.

Should probably get prettier (or another formatter) into this codebase at some point to make everything more consistent (and switch to non-deprecated ESLint too 😅)

@agilgur5 agilgur5 deleted the refactor-cache-walkTree-take-2 branch March 30, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: internal Changes only affect the internals, and _not_ the public API or external-facing docs scope: cache Related to the cache

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants