Jump to content

Repeated calculation of the same angle in FindValidPositionByFan results in a little resource waste


AlPt
  • Pending

the bird book will summon 21-30 birds(at first time), call FindValidPositionByFan(start_angle, radius, attempts=12, test_fn) many times.
and the local table "angles" is same when "attempts" is not changed. so cache the result will save a little resource.
my example patch is attched.

cacheFanAngles.patch


Steps to Reproduce

just open source and read the book.lua

  • Like 1



User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...