Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix JSON cache not being overwritten on subsequent writes#45

Merged
Demorome merged 1 commit into
Demorome:mainfrom
Stentorious:JSONFixes
Jan 29, 2026
Merged

Fix JSON cache not being overwritten on subsequent writes#45
Demorome merged 1 commit into
Demorome:mainfrom
Stentorious:JSONFixes

Conversation

@Stentorious

Copy link
Copy Markdown
Contributor

No description provided.

@Demorome

Demorome commented Jan 29, 2026

Copy link
Copy Markdown
Owner

You've correctly identified the issue; if the key existed before, then Emplace won't assign the data.

And it preserves the nice value-moving properties. I was probably overly cautious back then, seeing as push_back somehow didn't work nicely with value-moving, compared to emplace-style functions, but that's a separate issue, probably due to that function not using std::forward. But that's just a workaround trick function for template functions; it's not necessary if you just modify the ref directly by assigning it to a moved value.

Great work!

@Demorome Demorome merged commit 5990830 into Demorome:main Jan 29, 2026
1 check 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