-
Notifications
You must be signed in to change notification settings - Fork 16
Remove closure use in earlier stage #119
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
base: main
Are you sure you want to change the base?
Conversation
Remove the min parameter from makeFilter and hardcode the threshold to 54. Update the printed output and applied range to reflect the new threshold. This simplifies the filter function and aligns the output with the expected results.
WalkthroughThe function Changes
Estimated code review effort1 (~2 minutes) Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
stage_descriptions/functions-06-ey3.md (3)
123-131: Extract the magic number into a named constantThe threshold
54now shows up in three different spots (theiftest, the log string, and the loop bound). Encapsulating it in a singleMIN(or similarly-named) constant keeps the sample self-consistent and makes future edits trivial.fun makeFilter() { - fun filter(n) { - if (n < 54) { + var MIN = 54; + fun filter(n) { + if (n < MIN) { return false; } return true; } return filter; }
144-147: Rename helper to reflect the fixed threshold
greaterThanXimplies a variable lower bound that no longer exists. Renaming improves clarity and avoids misleading future readers.-var greaterThanX = makeFilter(); +var greaterThan54 = makeFilter(); -print "Numbers >= 54:"; -applyToNumbers(greaterThanX, 54 + 6); +print "Numbers >= 54:"; +applyToNumbers(greaterThan54, 54 + 6);
152-160: Add a language hint to the fenced output block (MD040)Markdown-lint flags this block because it lacks a language spec.
Usingtext(oroutput) silences the warning without affecting rendering.-``` +```text Numbers >= 54: 54 55 56 57 58 59</blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 6a35b33d7d5a674654876da99c29fc40228f92ac and 9f2b9d729f4c81c9a616e4b47246ecc1d2c4426a. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `stage_descriptions/functions-06-ey3.md` (2 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> <details> <summary>stage_descriptions/functions-06-ey3.md</summary> 152-152: Fenced code blocks should have a language specified (MD040, fenced-code-language) </details> </details> </details> <details> <summary>⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)</summary> * GitHub Check: test_course_definition / test (zig) * GitHub Check: test_course_definition / test (ocaml) * GitHub Check: test_course_definition / test (typescript) * GitHub Check: test_course_definition / test (swift) * GitHub Check: test_course_definition / test (kotlin) * GitHub Check: test_course_definition / test (java) * GitHub Check: test_course_definition / test (go) * GitHub Check: test_course_definition / test (c) * GitHub Check: test_course_definition / test (cpp) </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Accompanies: codecrafters-io/interpreter-tester#92
Summary by CodeRabbit