cache: factor out common code
cache: factor out common code

Factored out code common to decorator and ldeco into a new function.

theonlydude/RandomMetroidSolver,theonlydude/RandomMetroidSolver,theonlydude/RandomMetroidSolver,theonlydude/RandomMetroidSolver,theonlydude/RandomMetroidSolver