From be68462b1b48275e54acfccff3ab71842e733791 Mon Sep 17 00:00:00 2001 From: "Peter J. Jones" Date: Mon, 14 Sep 2026 13:25:29 +0200 Subject: [PATCH 1/2] Correctly sort array entries (fixes #22) --- src/data/array_index.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/array_index.cpp b/src/data/array_index.cpp index ec2849b..e0214c0 100644 --- a/src/data/array_index.cpp +++ b/src/data/array_index.cpp @@ -23,8 +23,10 @@ namespace MzPeak::Data { struct EntryCmpFn { bool operator()(const ArrayIndex::Entry& a, const ArrayIndex::Entry& b) const { - return a.array_name < b.array_name && a.array_type < b.array_type && - a.data_type < b.data_type && a.buffer_priority > b.buffer_priority; + if (a.array_name != b.array_name) return a.array_name < b.array_name; + if (a.array_type != b.array_type) return a.array_type < b.array_type; + if (a.data_type != b.data_type) return a.data_type < b.data_type; + return a.buffer_priority > b.buffer_priority; } }; From 3683349f27b18cf849d5133f21994dc1848ea505 Mon Sep 17 00:00:00 2001 From: "Peter J. Jones" Date: Mon, 14 Sep 2026 13:27:55 +0200 Subject: [PATCH 2/2] Use the correct name for the wavelength spectrum entity (fixes #21) --- src/schema/entity_type.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schema/entity_type.cpp b/src/schema/entity_type.cpp index 741c01f..215a3c0 100644 --- a/src/schema/entity_type.cpp +++ b/src/schema/entity_type.cpp @@ -23,7 +23,7 @@ std::string entity_type_to_string(EntityType::Type t) case Chromatogram: return "chromatogram"; case WavelengthSpectrum: - return "wavelength spectrum"; + return "wavelength_spectrum"; } std::unreachable(); @@ -38,7 +38,7 @@ EntityType::value_type entity_type_from_string(std::string_view s) return Spectrum; } else if (s == "chromatogram") { return Chromatogram; - } else if (s == "wavelength spectrum") { + } else if (s == "wavelength_spectrum") { return WavelengthSpectrum; } else { return std::string(s);