Making code more readable by removing global variable used for optimizations
Using the stack was more efficient because it prevented the creation of new rectangles but it makes the code harder to read and prone to bugs if the global state of the stack of rectangles gets corrupted in any way. When this optimization was written in 2008 it was necessary but now I don't think it would have a big impact. The stack size is on average of 30 and the rectangles are only created when doing the reorder which runs about once per second if the user moves the finger too quickly. Bug: 188081026 Test: atest ReorderWidgets Change-Id: I35d8ee8d92f01035e72fe5763a7de47f4b6a73de
Loading
Please register or sign in to comment