Skip to content

refactor: collecting inlines for subjects #1402

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

Merged
merged 1 commit into from
Jun 8, 2025

Conversation

sina-hide
Copy link
Contributor

Instead of checking intersections of inline elements yourself before adding an inline element, the new class InlineElementCollector prevents intersections internally.

Additionally the inline elements are sorted by the new class, so it's no longer necessary to do this after adding the inline elements.

Instead of checking intersections of inline elements yourself before
adding an inline element, the new class `InlineElementCollector`
prevents intersections internally.

Additionally the inline elements are sorted by the new class, so it's no
longer necessary to do this after adding the inline elements.
@love-linger love-linger self-assigned this Jun 8, 2025
@love-linger love-linger added the code-style Code style label Jun 8, 2025
@love-linger love-linger merged commit fe54d30 into sourcegit-scm:develop Jun 8, 2025
13 checks passed
love-linger added a commit that referenced this pull request Jun 8, 2025
- it's unnecessary to implement `IEnumerable` interface
- we should check `IsIntersecting` before creating `InlineElement` to avoid unnecessary works suck as running `git cat-file -t <hash>`
- sort whold list after all elements have been added to avoid unnecessary memmove in `Insert`

Signed-off-by: leo <longshuang@msn.cn>
@sina-hide sina-hide deleted the inline-elements branch June 8, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-style Code style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants