I've seen a slide which advises to cache with a dictionary. In which case we can even get the same budget twice? What does it save?
The API docs state that:
getBudget()
Returns the budget of the campaign. In order to change the campaign's budget,
I've seen a slide which advises to cache with a dictionary. In which case we can even get the same budget twice? What does it save?
The API docs state that:
getBudget()
Returns the budget of the campaign. In order to change the campaign's budget,
The map isn't used to cache the budgets, it's to avoid doubling the same budget more than once.
If you were to remove that part of the code, a budget that is shared by multiple campaigns would be doubled the number of times it is used in an individual campaign (e.g. if a budget is used in 3 campaigns, it would be increased eightfold after you run the script).