Skip to content

Commit

Permalink
Moving a few more std::find's to loops
Browse files Browse the repository at this point in the history
  • Loading branch information
amirroth committed Dec 11, 2024
1 parent 60706a3 commit 1c1ead8
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/EnergyPlus/ScheduleManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1035,9 +1035,11 @@ namespace Sched {
}

// Have processed all named days, check to make sure all given
if (std::find(allDays.begin(), allDays.end(), false) != allDays.end()) {
for (int iDayType = iDayType_Sun; iDayType < (int)DayType::Num; ++iDayType) {
if (allDays[iDayType] == true) continue;
ShowSevereError(state, format("{}: {}=\"{}\", Missing some day assignments", routineName, CurrentModuleObject, Alphas(1)));
ErrorsFound = true;
break;
}
}
NumRegWeekSchedules = Count;
Expand Down Expand Up @@ -1369,18 +1371,21 @@ namespace Sched {
}

For_exit:;
if (std::find(&allDays[iDayType_Sun], &allDays[(int)DayType::Num], false) != &allDays[(int)DayType::Num]) {
for (int iDayType = iDayType_Sun; iDayType < (int)DayType::Num; ++iDayType) {
if (allDays[iDayType] == true) continue;

ShowWarningCustom(state, eoh, format("has missing day types in Through={}", CurrentThrough));
ShowContinueError(state, format("Last \"For\" field={}", LastFor));
std::string errmsg = "Missing day types=,";
for (int kDayType = 1; kDayType < (int)DayType::Num; ++kDayType) {
if (allDays[kDayType]) continue;
errmsg.erase(errmsg.length() - 1);
errmsg = format("{} \"{}\",-", errmsg, dayTypeNames[kDayType]);
for (int kDayType = iDayType_Sun; kDayType < (int)DayType::Num; ++kDayType) {
if (allDays[kDayType]) continue;
errmsg.erase(errmsg.length() - 1);
errmsg = format("{} \"{}\",-", errmsg, dayTypeNames[kDayType]);
}
errmsg.erase(errmsg.length() - 2);
ShowContinueError(state, errmsg);
ShowContinueError(state, "Missing day types will have 0.0 as Schedule Values");
break;
}
}

Expand Down

3 comments on commit 1c1ead8

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScheduleAPI (amirroth) - x86_64-Linux-Ubuntu-24.04-gcc-13.2: OK (2862 of 2918 tests passed, 0 test warnings)

Failures:\n

API Test Summary

  • Passed: 14
  • Subprocess aborted: 2

EnergyPlusFixture Test Summary

  • Passed: 1600
  • Failed: 2
  • Subprocess aborted: 3

integration Test Summary

  • Passed: 753
  • Failed: 48

performance Test Summary

  • Passed: 16
  • Failed: 1

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScheduleAPI (amirroth) - x86_64-Linux-Ubuntu-24.04-gcc-13.2-UnitTestsCoverage-RelWithDebInfo: OK (2093 of 2100 tests passed, 0 test warnings)

Failures:\n

API Test Summary

  • Passed: 14
  • Subprocess aborted: 2

EnergyPlusFixture Test Summary

  • Passed: 1600
  • Failed: 2
  • Subprocess aborted: 3

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScheduleAPI (amirroth) - x86_64-Linux-Ubuntu-24.04-gcc-13.2-IntegrationCoverage-RelWithDebInfo: OK (753 of 801 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 753
  • Failed: 48

Build Badge Test Badge Coverage Badge

Please sign in to comment.