Remove unused parameter in Fragment.findIndex #88

Merged
ocavue merged 1 commit from ocavue/clean-find-index-round into master 2025-05-20 13:41:09 +02:00
ocavue commented 2025-05-20 01:05:01 +02:00 (Migrated from github.com)

While reading the source code of prosemirror-model, I noticed all calls to .findIndex() only use the first parameter (search result link). The second parameter round is unused thus can be removed. This method is an internal API so it shouldn't be a breaking change.

While reading the source code of `prosemirror-model`, I noticed all calls to `.findIndex()` only use the first parameter ([search result link]( https://github.com/search?q=repo%3AProseMirror%2Fprosemirror-model%20findIndex&type=code )). The second parameter `round` is unused thus can be removed. This method is an internal API so it shouldn't be a breaking change.
marijnh commented 2025-05-20 08:05:32 +02:00 (Migrated from github.com)

This is a public function, meaning there will be calls to it in code outside the repository, which may well be using this parameter. As such, and also since the savings of this change are minimal and it removes a useful feature, I don't think it's a good idea to remove it.

This is a public function, meaning there will be calls to it in code outside the repository, which may well be using this parameter. As such, and also since the savings of this change are minimal and it removes a useful feature, I don't think it's a good idea to remove it.
ocavue commented 2025-05-20 11:10:07 +02:00 (Migrated from github.com)

It seems to be an internal method based on the comments and this commit github.com/ProseMirror/prosemirror-model@d326751964

It seems to be an internal method based on the comments and this commit https://github.com/ProseMirror/prosemirror-model/commit/d326751964dda0297b54a6849e835d14b47430e3
marijnh commented 2025-05-20 13:40:43 +02:00 (Migrated from github.com)

Oh right, it has a doc comment but is marked @internal after all. Well, I suppose we can remove this parameter then.

Oh right, it has a doc comment but is marked @internal after all. Well, I suppose we can remove this parameter then.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror-model!88
No description provided.