SPMI: Avoid duplicate key lookups on replay (#78597)
authorJakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Mon, 21 Nov 2022 20:11:18 +0000 (21:11 +0100)
committerGitHub <noreply@github.com>
Mon, 21 Nov 2022 20:11:18 +0000 (21:11 +0100)
commit5005b60213677e6cb546b209346a28cb9d6af8ff
treeff61b47a8c95044ab312d5b1967d999ea49a44cd
parent87a37b8cd6450fa0e519c12746cd5ef4ca122e52
SPMI: Avoid duplicate key lookups on replay (#78597)

The commonly used pattern AssertMapAndKeyExists followed by map->Get
means we do two key lookups. Change the macros to return the value after
we have verified that the key exists. This makes replay 2-3% faster and
avoids some of the boilerplate.
src/coreclr/tools/superpmi/superpmi-shared/errorhandling.h
src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp