The expensive call is already done. And you are even already iterating over the result. The only thing this would add is maybe having to do 1 or 2 more iterations (I don't expect more than 3 protectors in the same area which means only 1 or 2 more get_meta(), the only expensive call in the loop). And this is in the worst case scenario, most of the time you could even return already as soon as you find a node with no priority assigned (and assume no priority is highest priority) and when placing it, if there were no conflicting areas not owned by you (which you are checking for already as well) you don't have to save any priority/timestamp since a protector placed without conflicts would always be highest priority.
The thing is that there are cases where "placing it properly in the first place" is not possible. See this case
Code: Select all
.P.... ...... ..x.R. ...... .P....