From 263bf93e0fa88e46608164f4ba7614d9b81d91ca Mon Sep 17 00:00:00 2001 From: "T. van der Zwan" Date: Tue, 5 Nov 2013 15:05:00 +0000 Subject: [PATCH] Fixed led-ordering based on their indices Former-commit-id: 835a9cede81fb717bf4862e318b673e9ebfb7cb5 --- libsrc/hyperion/Hyperion.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsrc/hyperion/Hyperion.cpp b/libsrc/hyperion/Hyperion.cpp index 4c3aa840..d818e651 100644 --- a/libsrc/hyperion/Hyperion.cpp +++ b/libsrc/hyperion/Hyperion.cpp @@ -147,6 +147,10 @@ LedString Hyperion::createLedString(const Json::Value& ledsConfig) ledString.leds().push_back(led); } + + // Make sure the leds are sorted (on their indices) + std::sort(ledString.leds().begin(), ledString.leds().end(), [](const Led& lhs, const Led& rhs){ return lhs.index < rhs.index; }); + return ledString; }