cache: Don't update cache if key is unchanged
cache: Don't update cache if key is unchanged

This is a micro-optimization to avoid a dictionary lookup when the key
is unchanged.

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