Skip to content

Commit 316b129

Browse files
Victoronzmockersf
authored andcommitted
fix QueryIter::sort_unstable_by (#16565)
# Objective `QueryIter::sort_unstable_by` is mistakenly using `slice::sort_by`. ## Solution Use `slice::sort_unstable_by`.
1 parent 3994f11 commit 316b129

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_ecs/src/query/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIter<'w, 's, D, F> {
774774
)
775775
};
776776
let mut keyed_query: Vec<_> = query_lens.collect();
777-
keyed_query.sort_by(|(key_1, _), (key_2, _)| compare(key_1, key_2));
777+
keyed_query.sort_unstable_by(|(key_1, _), (key_2, _)| compare(key_1, key_2));
778778
let entity_iter = keyed_query.into_iter().map(|(.., entity)| entity);
779779
// SAFETY:
780780
// `self.world` has permission to access the required components.

0 commit comments

Comments
 (0)