# Clarify Lamport ordering comment in remote edit \(\#52037\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/281cfdd7a207ea2fde46a8ff01a0045ee71e5374)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 281cfdd7a207ea2fde46a8ff01a0045ee71e5374

Requested commit: 281cfdd7a207ea2fde46a8ff01a0045ee71e5374

Commit: 281cfdd7a207ea2fde46a8ff01a0045ee71e5374

Tree: 8c11a01a17c295dca54102ac40d6043af81a4a01

Author: David Anekstein

Committer: GitHub

## Message

```
Clarify Lamport ordering comment in remote edit (#52037)

## Context

This PR updates a misleading comment in the remote edit merge path in
the text CRDT.

At `crates/text/src/text.rs`, the code skips fragments when
`fragment.timestamp > timestamp`, but the comment described this as
"lower lamport timestamp." In this codebase, Lamport ordering is
ascending (`value`, then `replica_id`), so `>` means a higher Lamport
timestamp.

This change is comment-only and does not change runtime behavior.

## How to Review

1. Open `crates/text/src/text.rs` and inspect the updated two-line
comment above the `while let Some(fragment) = old_fragments.item()` loop
in `apply_remote_edit`.
2. Confirm the condition directly below is unchanged:
`fragment.timestamp > timestamp`.
3. (Optional) Cross-check Lamport ordering in
`crates/clock/src/clock.rs` (`impl Ord for Lamport`) to confirm the
wording.

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior (comment-only change; no
behavior changes)
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A

Co-authored-by: Lukas Wirth <lukas@zed.dev>
```

## Parents

- [707c00b474b7c7c82e59d31d1e7ca3a58c614953](https://git.cafe/gitcafe/zed/commit/707c00b474b7c7c82e59d31d1e7ca3a58c614953?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/281cfdd7a207ea2fde46a8ff01a0045ee71e5374?format=markdown)
