We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee29828 commit a432f2aCopy full SHA for a432f2a
sway-core/src/engine_threading.rs
@@ -358,16 +358,15 @@ impl<T: OrdWithEngines> OrdWithEngines for Option<T> {
358
359
impl<T: OrdWithEngines> OrdWithEngines for Vec<T> {
360
fn cmp(&self, other: &Self, ctx: &OrdWithEnginesContext) -> Ordering {
361
- if self.len() == other.len() {
362
- self.iter()
+ match self.len().cmp(&other.len()) {
+ Ordering::Less => Ordering::Less,
363
+ Ordering::Equal => self
364
+ .iter()
365
.zip(other.iter())
366
.fold(Ordering::Equal, |accumulator, values| {
367
accumulator.then_with(|| values.0.cmp(values.1, ctx))
- })
- } else if self.len() < other.len() {
368
- Ordering::Less
369
- } else {
370
- Ordering::Greater
+ }),
+ Ordering::Greater => Ordering::Greater,
371
}
372
373
0 commit comments