File tree Expand file tree Collapse file tree 4 files changed +5
-29
lines changed Expand file tree Collapse file tree 4 files changed +5
-29
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ impl TaskPoolThreadAssignmentPolicy {
2727 // Clamp by min_threads, max_threads. (This may result in us using more threads than are
2828 // available, this is intended. An example case where this might happen is a device with
2929 // <= 2 threads.
30- bevy_math :: clamp ( desired , self . min_threads , self . max_threads )
30+ desired . clamp ( self . min_threads , self . max_threads )
3131 }
3232}
3333
@@ -94,11 +94,8 @@ impl DefaultTaskPoolOptions {
9494
9595 /// Inserts the default thread pools into the given resource map based on the configured values
9696 pub fn create_default_pools ( & self , world : & mut World ) {
97- let total_threads = bevy_math:: clamp (
98- bevy_tasks:: logical_core_count ( ) ,
99- self . min_total_threads ,
100- self . max_total_threads ,
101- ) ;
97+ let total_threads =
98+ bevy_tasks:: logical_core_count ( ) . clamp ( self . min_total_threads , self . max_total_threads ) ;
10299 trace ! ( "Assigning {} cores to default task pools" , total_threads) ;
103100
104101 let mut remaining_threads = total_threads;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- mod clamp;
21mod face_toward;
32mod geometry;
43
5- pub use clamp:: * ;
64pub use face_toward:: * ;
75pub use geometry:: * ;
86pub use glam:: * ;
Original file line number Diff line number Diff line change @@ -177,8 +177,8 @@ impl TextureAtlasBuilder {
177177 Some ( rect_placements)
178178 }
179179 Err ( rectangle_pack:: RectanglePackError :: NotEnoughBinSpace ) => {
180- current_height = bevy_math :: clamp ( current_height * 2 , 0 , max_height) ;
181- current_width = bevy_math :: clamp ( current_width * 2 , 0 , max_width) ;
180+ current_height = ( current_height * 2 ) . clamp ( 0 , max_height) ;
181+ current_width = ( current_width * 2 ) . clamp ( 0 , max_width) ;
182182 None
183183 }
184184 } ;
You can’t perform that action at this time.
0 commit comments