Skip to content

Commit

Permalink
Don't depend on ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
FigBug committed Feb 15, 2024
1 parent 93627e6 commit 251d11f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 6 additions & 6 deletions modules/gin_plugin/components/gin_msegcomponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,18 +523,18 @@ void MSEGComponent::mouseDragDraw (const juce::MouseEvent& e)

auto v1 = [&]
{
for (const auto p : data.points)
if (std::abs (p.time - t1) < 0.000001f)
return p.value;
for (auto i = 0; i < data.numPoints; i++)
if (std::abs (data.points[i].time - t1) < 0.000001f)
return data.points[i].value;

return mseg.getValueAt (t1 - 0.000001f);
}();

auto v2 = [&]
{
for (const auto p : std::ranges::views::reverse (data.points))
if (std::abs (p.time - t2) < 0.000001f)
return p.value;
for (auto i = data.numPoints; --i >= 0;)
if (std::abs (data.points[i].time - t2) < 0.000001f)
return data.points[i].value;

return mseg.getValueAt (t2 + 0.000001f);
}();
Expand Down
2 changes: 0 additions & 2 deletions modules/gin_plugin/gin_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@
#include <gin_graphics/gin_graphics.h>

#include <map>
#include <ranges>
#include <vector>

namespace juce
{
Expand Down

0 comments on commit 251d11f

Please sign in to comment.