[PR #417] [MERGED] Cleanup StringBuilderCache #1005

Open
opened 2026-01-29 14:48:29 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/xoofx/markdig/pull/417
Author: @KrisVandermotten
Created: 4/13/2020
Status: Merged
Merged: 4/18/2020
Merged by: @xoofx

Base: masterHead: StringBuilderCache


📝 Commits (3)

  • 305f722 Cleanup StringBuilderCache
  • 14fb550 Merge branch 'master' into StringBuilderCache
  • a19f783 merged from master

📊 Changes

8 files changed (+8 additions, -52 deletions)

View changed files

📝 src/Markdig/Helpers/LinkHelper.cs (+0 -2)
📝 src/Markdig/Helpers/StringBuilderCache.cs (+2 -14)
📝 src/Markdig/MarkdownPipeline.cs (+1 -4)
📝 src/Markdig/MarkdownPipelineBuilder.cs (+0 -8)
📝 src/Markdig/Parsers/BlockProcessor.cs (+1 -9)
📝 src/Markdig/Parsers/InlineProcessor.cs (+1 -8)
📝 src/Markdig/Parsers/Inlines/CodeInlineParser.cs (+1 -3)
📝 src/Markdig/Parsers/MarkdownParser.cs (+2 -4)

📄 Description

StringBuilderCache used to inherit from DefaultObjectCache<StringBuilder>, and instances were being passed around.

However, nobody was actually using those instances, with one exception: CodeInlineParser.

All other code uses StringBuilderCache.Local(). As it turns out, there is actually no reason why CodeInlineParser could not do the same.

This PR changes StringBuilderCache to be a static class, no longer inheriting from DefaultObjectCache<StringBuilder>. All references to instances are removed. CodeInlineParser was modified to use StringBuilderCache.Local() as well.

It goes without saying that this is a breaking change, as the class and most of the instance references were public.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/xoofx/markdig/pull/417 **Author:** [@KrisVandermotten](https://github.com/KrisVandermotten) **Created:** 4/13/2020 **Status:** ✅ Merged **Merged:** 4/18/2020 **Merged by:** [@xoofx](https://github.com/xoofx) **Base:** `master` ← **Head:** `StringBuilderCache` --- ### 📝 Commits (3) - [`305f722`](https://github.com/xoofx/markdig/commit/305f722899dcba331950fb7755d78b2751314b27) Cleanup StringBuilderCache - [`14fb550`](https://github.com/xoofx/markdig/commit/14fb5507045159b3eb0f5b0397b13d6bdee237e1) Merge branch 'master' into StringBuilderCache - [`a19f783`](https://github.com/xoofx/markdig/commit/a19f78342f1d8450f9804cde8fc6ba7e5a536fb4) merged from master ### 📊 Changes **8 files changed** (+8 additions, -52 deletions) <details> <summary>View changed files</summary> 📝 `src/Markdig/Helpers/LinkHelper.cs` (+0 -2) 📝 `src/Markdig/Helpers/StringBuilderCache.cs` (+2 -14) 📝 `src/Markdig/MarkdownPipeline.cs` (+1 -4) 📝 `src/Markdig/MarkdownPipelineBuilder.cs` (+0 -8) 📝 `src/Markdig/Parsers/BlockProcessor.cs` (+1 -9) 📝 `src/Markdig/Parsers/InlineProcessor.cs` (+1 -8) 📝 `src/Markdig/Parsers/Inlines/CodeInlineParser.cs` (+1 -3) 📝 `src/Markdig/Parsers/MarkdownParser.cs` (+2 -4) </details> ### 📄 Description `StringBuilderCache` used to inherit from `DefaultObjectCache<StringBuilder>`, and instances were being passed around. However, nobody was actually using those instances, with one exception: `CodeInlineParser`. All other code uses `StringBuilderCache.Local()`. As it turns out, there is actually no reason why `CodeInlineParser` could not do the same. This PR changes `StringBuilderCache` to be a `static class`, no longer inheriting from `DefaultObjectCache<StringBuilder>`. All references to instances are removed. `CodeInlineParser` was modified to use `StringBuilderCache.Local()` as well. It goes without saying that this is a breaking change, as the class and most of the instance references were public. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 14:48:29 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#1005