Skip to content

Commit ddce5d9

Browse files
def-antiguru
andauthored
Update src/repr/src/row/encode.rs
Co-authored-by: Moritz Hoffmann <antiguru@gmail.com>
1 parent 84d109e commit ddce5d9

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/repr/src/row/encode.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,14 +2126,12 @@ impl RowPacker<'_> {
21262126
// Map keys must be unique and strictly ascending; iterating a
21272127
// map that violates this trips a debug_assert. A crafted
21282128
// proto can, so reject it as a decode error here instead.
2129-
if let Some(prev) = prev_key {
2130-
if e.key.as_str() <= prev {
2131-
return Err(format!(
2132-
"dict keys must be unique and in ascending order, \
2133-
but {:?} came after {:?}",
2134-
e.key, prev,
2135-
));
2136-
}
2129+
if let Some(prev) = prev_key && e.key.as_str() <= prev {
2130+
return Err(format!(
2131+
"dict keys must be unique and in ascending order, \
2132+
but {:?} came after {:?}",
2133+
e.key, prev,
2134+
));
21372135
}
21382136
prev_key = Some(e.key.as_str());
21392137
row.push(Datum::from(e.key.as_str()));

0 commit comments

Comments
 (0)