Skip to content

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