Skip to content

Commit e0cc541

Browse files
desc by offset within the same partition, otherwise rely on timestamp
1 parent 1eb7e86 commit e0cc541

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/stream/stream.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,9 @@ export class Stream {
4141
1 / 4,
4242
(point: number) => values[point],
4343
(a, b) => {
44-
return (
45-
descending(a.timestamp, b.timestamp) ||
46-
descending(a.partition_id, b.partition_id) ||
47-
descending(a.offset, b.offset)
48-
);
44+
return a.partition_id === b.partition_id
45+
? descending(a.offset, b.offset)
46+
: descending(a.timestamp, b.timestamp);
4947
},
5048
);
5149
}

0 commit comments

Comments
 (0)