Closed Bug 1649704 Opened 5 years ago Closed 5 years ago

Improve consistency of Span's span_iterator comparison

Categories

(Core :: MFBT, task)

task

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: sg, Assigned: sg)

Details

Attachments

(1 file)

Currently, comparing span_iterator instances from different span instances will

  • will report them as unequal when compared via == or !=
  • will trigger a release-mode assertion failure when compared via <, <=, > or >=
    which seems inconsistent.

The second behaviour seems more sound. However, a MOZ_DIAGNOSTIC_ASSERT should be enough here since this doesn't affect the validity of iterator accesses.

Apart from that, it might be surprising that iterators derived from different spans are not comparable even if they were derived from the same base span using Subspan or similar methods. However, possibly changing this is a different issue. In the context of this bug, I will just add a comment to make that clearer.

Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a22dfb5eb460 Improve consistency of Span's span_iterator comparison. r=froydnj
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: