Skip to content

Commit

Permalink
some minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jul 14, 2020
1 parent 928cbb8 commit 5e05dfd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Etterna/MinaCalc/CalcWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ struct CalcMovingWindow

// we can basically just branch to ccacc or acca checks depending on
// which value is higher
auto o = false;
bool o;
if (_itv_vals[4] > _itv_vals[5]) {
// if middle is higher, run the ccacc check that will divide it
o = ccacc_timing_check(factor, threshold);
Expand Down
4 changes: 2 additions & 2 deletions src/Etterna/MinaCalc/MinaCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,8 @@ Calc::Chisel(float player_skill,
const bool debugoutput) -> float
{
auto gotpoints = 0.F;
const auto reqpoints = MaxPoints * score_goal;
const auto max_slap_dash_jack_cap_hack_tech_hat = MaxPoints * 0.1F;
static const auto reqpoints = MaxPoints * score_goal;
static const auto max_slap_dash_jack_cap_hack_tech_hat = MaxPoints * 0.1F;
for (auto iter = 1; iter <= 8; iter++) {
do {
// overall and stamina are calculated differently
Expand Down
20 changes: 11 additions & 9 deletions src/Etterna/MinaCalc/UlbuAcolytes.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ static const std::array<unsigned, num_hands> hand_col_ids = { 3, 12 };
static const float interval_span = 0.5F;

inline void
Smooth(std::array<float, max_intervals>& input, float neutral, int end_interval)
Smooth(std::array<float, max_intervals>& input,
const float neutral,
const int end_interval)
{
auto f2 = neutral;
auto f3 = neutral;

for (auto i = 0; i < end_interval; ++i) {
float f1 = f2;
const auto f1 = f2;
f2 = f3;
f3 = input.at(i);
input.at(i) = (f1 + f2 + f3) / 3.F;
Expand All @@ -33,13 +35,13 @@ Smooth(std::array<float, max_intervals>& input, float neutral, int end_interval)

inline void
MSSmooth(std::array<float, max_intervals>& input,
float neutral,
int end_interval)
const float neutral,
const int end_interval)
{
auto f2 = neutral;

for (auto i = 0; i < end_interval; ++i) {
float f1 = f2;
const auto f1 = f2;
f2 = input.at(i);
input.at(i) = (f1 + f2) / 2.F;
}
Expand Down Expand Up @@ -77,14 +79,14 @@ struct PatternMods

static void run_agnostic_smoothing_pass(const int& end_itv, Calc& calc)
{
for (auto& pmod : agnostic_mods) {
for (const auto& pmod : agnostic_mods) {
Smooth(calc.doot.at(left_hand).at(pmod), neutral, end_itv);
}
}

static void run_dependent_smoothing_pass(const int& end_itv, Calc& calc)
{
for (auto& pmod : dependent_mods) {
for (const auto& pmod : dependent_mods) {
for (auto& h : calc.doot) {
Smooth(h.at(pmod), neutral, end_itv);
}
Expand All @@ -93,7 +95,7 @@ struct PatternMods

static void bruh_they_the_same(const int& end_itv, Calc& calc)
{
for (auto& pmod : agnostic_mods) {
for (const auto& pmod : agnostic_mods) {
for (auto i = 0; i < end_itv; i++) {
calc.doot.at(right_hand).at(pmod).at(i) =
calc.doot.at(left_hand).at(pmod).at(i);
Expand Down Expand Up @@ -130,7 +132,7 @@ fast_walk_and_check_for_skip(const std::vector<NoteInfo>& ni,

// for various reasons we actually have to do this, scan the file and make
// sure each successive row time is greater than the last
for (auto i = 1; i < ni.size(); ++i) {
for (auto i = 1; i < static_cast<int>(ni.size()); ++i) {
if (ni.at(i - 1).rowTime >= ni.at(i).rowTime) {
return true;
}
Expand Down

0 comments on commit 5e05dfd

Please sign in to comment.