light refactoring: forbid modification of SoftSparkLimiter::allowHardCut field (#6566)

This commit is contained in:
kifir 2024-06-06 16:33:23 +03:00 committed by rusefillc
parent d87d84138f
commit eda1a54047
2 changed files with 4 additions and 4 deletions

View File

@ -158,8 +158,8 @@ bool LaunchControlBase::isLaunchFuelRpmRetardCondition() const {
return isLaunchRpmRetardCondition() && engineConfiguration->launchFuelCutEnable;
}
SoftSparkLimiter::SoftSparkLimiter(bool p_allowHardCut) {
this->allowHardCut = p_allowHardCut;
SoftSparkLimiter::SoftSparkLimiter(const bool p_allowHardCut)
: allowHardCut(p_allowHardCut) {
#if EFI_UNIT_TEST
initLaunchControl();
#endif // EFI_UNIT_TEST

View File

@ -46,7 +46,7 @@ private:
*/
class SoftSparkLimiter {
public:
SoftSparkLimiter(bool allowHardCut);
SoftSparkLimiter(bool p_allowHardCut);
/**
* targetSkipRatio of '0' means 'do not skip', would always return false
*/
@ -55,7 +55,7 @@ public:
bool shouldSkip();
private:
bool allowHardCut;
const bool allowHardCut;
bool wasJustSkipped = false;
float targetSkipRatio = 0;
};