Skip to content

Commit

Permalink
Address 2 compiler warnings (#357)
Browse files Browse the repository at this point in the history
* bugfix: remove redefinition of variable

* remove ineffective check, comparison of unsigned expression >=0 is always true
  • Loading branch information
anilbey authored Jan 11, 2024
1 parent 7292382 commit 328153e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions efel/cppcore/LibV5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1458,14 +1458,12 @@ int LibV5::current_base(mapStr2intVec& IntFeatureData,
double cb_end_perc = 1.0; // Default value

try {
const double cb_start_perc =
getFeature(DoubleFeatureData, "current_base_start_perc")[0];
cb_start_perc = getFeature(DoubleFeatureData, "current_base_start_perc")[0];
} catch (const std::runtime_error&) {
} // Use default value if not found or an error occurs

try {
const double cb_end_perc =
getFeature(DoubleFeatureData, "current_base_end_perc")[0];
cb_end_perc = getFeature(DoubleFeatureData, "current_base_end_perc")[0];
} catch (const std::runtime_error&) {
} // Use default value if not found or an error occurs

Expand Down Expand Up @@ -1600,13 +1598,11 @@ int LibV5::multiple_decay_time_constant_after_stim(
double decay_start_after_stim = 1.0;
double decay_end_after_stim = 10.0;
try {
const double decay_start_after_stim =
getFeature(DoubleFeatureData, "decay_start_after_stim")[0];
decay_start_after_stim = getFeature(DoubleFeatureData, "decay_start_after_stim")[0];
} catch (const std::runtime_error&) {
} // Use default value
try {
const double decay_end_after_stim =
getFeature(DoubleFeatureData, "decay_end_after_stim")[0];
decay_end_after_stim = getFeature(DoubleFeatureData, "decay_end_after_stim")[0];
} catch (const std::runtime_error&) {
} // Use default value
vector<double> dtcas;
Expand Down Expand Up @@ -1799,7 +1795,6 @@ static int __peak_indices(double threshold, const vector<double>& V,
if (itmp_set) {
if (strict_stiminterval) {
EFEL_ASSERT(itmp < t.size(), "peak_time falls outside of time array");
EFEL_ASSERT(itmp >= 0, "peak_time is negative");
if (t[itmp] >= stim_start && t[itmp] <= stim_end) {
PeakIndex.push_back(itmp);
}
Expand Down

0 comments on commit 328153e

Please sign in to comment.