File tree 1 file changed +5
-0
lines changed
crates/bevy_ecs/src/entity
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ impl Entity {
123
123
/// for serialization between runs.
124
124
///
125
125
/// No particular structure is guaranteed for the returned bits.
126
+ #[ inline( always) ]
126
127
pub fn to_bits ( self ) -> u64 {
127
128
u64:: from ( self . generation ) << 32 | u64:: from ( self . id )
128
129
}
@@ -158,25 +159,29 @@ impl Entity {
158
159
159
160
// Required for ordering correctness. Cannot be done with a derive macro.
160
161
impl PartialOrd for Entity {
162
+ #[ inline]
161
163
fn partial_cmp ( & self , other : & Self ) -> Option < CmpOrdering > {
162
164
Some ( self . to_bits ( ) . cmp ( & other. to_bits ( ) ) )
163
165
}
164
166
}
165
167
166
168
// Required for ordering correctness. Cannot be done with a derive macro.
167
169
impl Ord for Entity {
170
+ #[ inline]
168
171
fn cmp ( & self , other : & Self ) -> CmpOrdering {
169
172
self . to_bits ( ) . cmp ( & other. to_bits ( ) )
170
173
}
171
174
}
172
175
173
176
impl Hash for Entity {
177
+ #[ inline]
174
178
fn hash < H : Hasher > ( & self , hasher : & mut H ) {
175
179
self . to_bits ( ) . hash ( hasher)
176
180
}
177
181
}
178
182
179
183
impl PartialEq for Entity {
184
+ #[ inline]
180
185
fn eq ( & self , other : & Self ) -> bool {
181
186
self . to_bits ( ) == other. to_bits ( )
182
187
}
You can’t perform that action at this time.
0 commit comments