mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-19 03:01:11 +01:00
Sort inline comments by id in case of ties
Summary: This ensures that two comments by the same author on the same line are sorted properly. Test Plan: Before this patch, made two comments that appeared in the wrong order. With this patch, they sort correctly. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D8697
This commit is contained in:
parent
8fad146832
commit
f9a92c7631
1 changed files with 4 additions and 3 deletions
|
@ -44,12 +44,13 @@ final class DifferentialTransactionComment
|
||||||
$items = array();
|
$items = array();
|
||||||
foreach ($group as $inline) {
|
foreach ($group as $inline) {
|
||||||
$comment = $inline->getComment();
|
$comment = $inline->getComment();
|
||||||
$num = (int)$comment->getLineNumber();
|
$num = $comment->getLineNumber();
|
||||||
$len = (int)$comment->getLineLength();
|
$len = $comment->getLineLength();
|
||||||
|
$id = $comment->getID();
|
||||||
|
|
||||||
$items[] = array(
|
$items[] = array(
|
||||||
'inline' => $inline,
|
'inline' => $inline,
|
||||||
'sort' => ($num << 16) + $len,
|
'sort' => sprintf('~%010d%010d%010d', $num, $len, $id),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue