This ensures that two comments by the same author on the same line are sorted properly.
Details
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Commits
- Restricted Diffusion Commit
rPf9a92c7631aa: Sort inline comments by id in case of ties
Before this patch, made two comments that appeared in the wrong order. With this patch, they sort correctly.
Diff Detail
Diff Detail
- Repository
- rP Phabricator
- Branch
- sort-inline
- Lint
Lint Passed - Unit
Tests Passed
Event Timeline
src/applications/differential/storage/DifferentialTransactionComment.php | ||
---|---|---|
48 | Are these casts unnecessary now? |
Comment Actions
I think the inlines passed in here always share the same author, so sorting by length doesn't actually make a ton of sense. What do you think about just <num, id>?
(The casts are unnecessary with sprintf().)
Comment Actions
(Even if, in the future, inlines by different authors are passed in here, sorting by id seems better in all cases than len to me, I think?)
Comment Actions
Well, you can have overlapping comment ranges, right? So I could have four comments like:
num len id 10 0 1001 10 0 1003 10 5 1002 10 5 1004
and they should be displayed in that order.