mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 10:59:20 +02:00
refactor(sonar): scope single-use variables in if init-statements (cpp:S6004)
This commit is contained in:
@@ -176,8 +176,7 @@ scenario_time::julian_day() const {
|
||||
// for dates in Julian calendar
|
||||
int JD = K1 + K2 + m_time.wDay + 59;
|
||||
// for dates in Gregorian calendar; 2299160 is October 15th, 1582
|
||||
const int gregorianswitchday = 2299160;
|
||||
if( JD > gregorianswitchday ) {
|
||||
if( const int gregorianswitchday = 2299160; JD > gregorianswitchday ) {
|
||||
|
||||
int K3 = static_cast<int>(std::floor( std::floor( yy * 0.01 + 49 ) * 0.75 ) - 38);
|
||||
JD -= K3;
|
||||
|
||||
Reference in New Issue
Block a user