MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / logDivergence

Function logDivergence

src/OpenLoco/src/GameSaveCompare.cpp:95–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94 template<typename T1, typename T2>
95 long logDivergence(const std::string type, const T1& lhs, const T2& rhs, int arraySize, bool displayAllDivergences)
96 {
97 long divergentBytesTotal = 0;
98 for (int offset = 0; offset < arraySize; offset++)
99 {
100 divergentBytesTotal = bitWiseLogDivergence(type + " [" + std::to_string(offset) + "]", lhs[offset], rhs[offset], displayAllDivergences, divergentBytesTotal);
101 }
102 if (!displayAllDivergences && divergentBytesTotal > 0)
103 {
104 Logging::info(" {} other diverging bytes omitted", divergentBytesTotal);
105 }
106 return divergentBytesTotal;
107 }
108
109 template<typename T1, typename T2>
110 bool isLoggedDivergence(const std::string type, const T1& lhs, const T2& rhs, int arraySize, bool displayAllDivergences)

Callers

nothing calls this directly

Calls 2

bitWiseLogDivergenceFunction · 0.85
infoFunction · 0.85

Tested by

no test coverage detected