Skip to content

Commit 3a2bcdc

Browse files
committed
reduce, const and unused
1 parent 4f8867b commit 3a2bcdc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/EnergyPlus/SQLiteProcedures.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ bool ParseSQLiteInput(EnergyPlusData &state, bool &writeOutputToSQLite, bool &wr
104104
return input;
105105
};
106106

107-
auto &sql_ort = state.dataOutRptTab;
108-
109107
// There can only be 1 "Output:SQLite"
110108
auto const instance = instances.value().begin();
111109
auto const &fields = instance.value();
@@ -123,6 +121,8 @@ bool ParseSQLiteInput(EnergyPlusData &state, bool &writeOutputToSQLite, bool &wr
123121
}
124122
{ // "unit_conversion_for_tabular_data"
125123
std::string tabularDataUnitConversion = find_input(fields, "unit_conversion_for_tabular_data");
124+
auto const &sql_ort = state.dataOutRptTab;
125+
126126
if ("UseOutputControlTableStyles" == tabularDataUnitConversion) {
127127
// Jan 2021 Note: Since here we do not know weather sql_ort->unitsStyle has been processed or not,
128128
// the value "NotFound" is used for the option "UseOutputControlTableStyles" at this point;
@@ -1577,7 +1577,6 @@ void SQLite::createSQLiteTimeIndexRecord(OutputProcessor::ReportFreq const repor
15771577
bool const warmupFlag)
15781578
{
15791579
if (m_writeOutputToSQLite) {
1580-
int intStartMinute = 0;
15811580
int intervalInMinutes = 60;
15821581

15831582
static std::vector<int> lastDayOfMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
@@ -1595,7 +1594,7 @@ void SQLite::createSQLiteTimeIndexRecord(OutputProcessor::ReportFreq const repor
15951594
++m_sqlDBTimeIndex;
15961595

15971596
int intEndMinute = static_cast<int>(endMinute + 0.5);
1598-
intStartMinute = static_cast<int>(startMinute + 0.5);
1597+
int intStartMinute = static_cast<int>(startMinute + 0.5);
15991598
int t_hour = hour;
16001599
intervalInMinutes = intEndMinute - intStartMinute;
16011600
adjustReportingHourAndMinutes(t_hour, intEndMinute);
@@ -2611,7 +2610,7 @@ SQLiteProcedures::SQLiteProcedures(std::shared_ptr<std::ostream> const &errorStr
26112610
{
26122611
sqlite3 *m_connection = nullptr;
26132612
if (m_writeOutputToSQLite) {
2614-
int rc = -1;
2613+
int rc;
26152614
bool ok = true;
26162615

26172616
std::string const dbName_utf8 = FileSystem::toGenericString(dbName);

0 commit comments

Comments
 (0)