MCPcopy
hub / github.com/grafana/k6 / Equal

Method Equal

lib/execution_segment.go:199–211  ·  view source on GitHub ↗

Equal returns true only if the two execution segments have the same from and to values.

(other *ExecutionSegment)

Source from the content-addressed store, hash-verified

197// Equal returns true only if the two execution segments have the same from and
198// to values.
199func (es *ExecutionSegment) Equal(other *ExecutionSegment) bool {
200 if es == other {
201 return true
202 }
203 thisFrom, otherFrom, thisTo, otherTo := zeroRat, zeroRat, oneRat, oneRat
204 if es != nil {
205 thisFrom, thisTo = es.from, es.to
206 }
207 if other != nil {
208 otherFrom, otherTo = other.from, other.to
209 }
210 return thisFrom.Cmp(otherFrom) == 0 && thisTo.Cmp(otherTo) == 0
211}
212
213// SubSegment returns a new execution sub-segment - if a is (1/2:1] and b is
214// (0:1/2], then a.SubSegment(b) will return a new segment (1/2, 3/4].

Calls

no outgoing calls