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

int("")==0; adding trim(), trim_left() and trim_right(); new -no-register option to disable register optimizations #272

Merged
merged 6 commits into from
Dec 11, 2024

Conversation

ldemailly
Copy link
Member

@ldemailly ldemailly commented Dec 11, 2024

Despite auto memoization, advent day11 is still too slow - todo: follow up further

@ldemailly ldemailly changed the title Allow leanier string to int conversion Allow more lenient string to int conversion Dec 11, 2024
@ldemailly ldemailly changed the title Allow more lenient string to int conversion Allow more lenient string to int conversion: trim spaces in strings, and "" is 0 Dec 11, 2024
@ldemailly ldemailly changed the title Allow more lenient string to int conversion: trim spaces in strings, and "" is 0 int(): trim spaces in strings, and "" is 0; adding trim(), trim_left() and trim_right() Dec 11, 2024
@@ -324,6 +324,8 @@ func createJSONAndEvalFunctions(c *Config) {
}
}

const DefaultTrimSet = " \r\n\t"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const DefaultTrimSet = " \r\n\t"
const defaultTrimSet = " \r\n\t"

Unless you plan to reuse it

Copy link
Member Author

Choose a reason for hiding this comment

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

I figured it would be good to get it documented (thus exposed)

@ldemailly ldemailly changed the title int(): trim spaces in strings, and "" is 0; adding trim(), trim_left() and trim_right() int(): trim spaces in strings, and "" is 0; adding trim(), trim_left() and trim_right(); new -no-register option to disable register optimizations Dec 11, 2024
@ldemailly ldemailly changed the title int(): trim spaces in strings, and "" is 0; adding trim(), trim_left() and trim_right(); new -no-register option to disable register optimizations int("")==0; adding trim(), trim_left() and trim_right(); new -no-register option to disable register optimizations Dec 11, 2024
@ldemailly ldemailly merged commit 7a7ec8e into main Dec 11, 2024
3 checks passed
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.

2 participants