Skip to content

Commit

Permalink
fixup! WaveformWidgetFactory: range-based loops, std:as_const
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Dec 23, 2023
1 parent 5c57aa8 commit 0fdabc0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/waveform/waveformwidgetfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1151,14 +1151,14 @@ WaveformWidgetType::Type WaveformWidgetFactory::findTypeFromHandleIndex(int inde
}

int WaveformWidgetFactory::findHandleIndexFromType(WaveformWidgetType::Type type) {
int index = 0;
for (const auto& handle : std::as_const(m_waveformWidgetHandles)) {
int index = -1;
for (int i = 0; i < m_waveformWidgetHandles.size(); i++) {
const WaveformWidgetAbstractHandle& handle = m_waveformWidgetHandles[i];
if (handle.m_type == type) {
return index;
index = i;
}
index++;
}
return -1;
return index;
}

QString WaveformWidgetFactory::getDisplayNameFromType(WaveformWidgetType::Type type) {
Expand Down

0 comments on commit 0fdabc0

Please sign in to comment.