File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
crates/bevy_ecs/src/entity Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ impl Entity {
123123 /// for serialization between runs.
124124 ///
125125 /// No particular structure is guaranteed for the returned bits.
126+ #[ inline( always) ]
126127 pub fn to_bits ( self ) -> u64 {
127128 u64:: from ( self . generation ) << 32 | u64:: from ( self . id )
128129 }
@@ -158,25 +159,29 @@ impl Entity {
158159
159160// Required for ordering correctness. Cannot be done with a derive macro.
160161impl PartialOrd for Entity {
162+ #[ inline]
161163 fn partial_cmp ( & self , other : & Self ) -> Option < CmpOrdering > {
162164 Some ( self . to_bits ( ) . cmp ( & other. to_bits ( ) ) )
163165 }
164166}
165167
166168// Required for ordering correctness. Cannot be done with a derive macro.
167169impl Ord for Entity {
170+ #[ inline]
168171 fn cmp ( & self , other : & Self ) -> CmpOrdering {
169172 self . to_bits ( ) . cmp ( & other. to_bits ( ) )
170173 }
171174}
172175
173176impl Hash for Entity {
177+ #[ inline]
174178 fn hash < H : Hasher > ( & self , hasher : & mut H ) {
175179 self . to_bits ( ) . hash ( hasher)
176180 }
177181}
178182
179183impl PartialEq for Entity {
184+ #[ inline]
180185 fn eq ( & self , other : & Self ) -> bool {
181186 self . to_bits ( ) == other. to_bits ( )
182187 }
You can’t perform that action at this time.
0 commit comments