We just released another short video for our free series on the Infer static analysis tool:
We cover an example that Facebook Infer would flag and warn you about. The idea is that you want a loop to be as efficient as possible and if you find a function that's being called repeatedly with the same result (a.k.a. an invariant), it can be safely hoisted outside of the loop.
You can read more about this at the Facebook Infer documentation site: https://fbinfer.com/docs/all-issue-types#invariant_call