From 26a43ca5e7f0122931b1f483987c57c26213553b Mon Sep 17 00:00:00 2001 From: LinZhihao-723 Date: Fri, 18 Oct 2024 01:01:42 -0400 Subject: [PATCH] Minor fix --- .../core/src/clp/ffi/ir_stream/utils.hpp | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/components/core/src/clp/ffi/ir_stream/utils.hpp b/components/core/src/clp/ffi/ir_stream/utils.hpp index a323df8a7..3e545c4fe 100644 --- a/components/core/src/clp/ffi/ir_stream/utils.hpp +++ b/components/core/src/clp/ffi/ir_stream/utils.hpp @@ -209,30 +209,25 @@ auto encode_and_serialize_schema_tree_node_id( std::vector& output_buf ) -> bool { auto size_dependent_encode_and_serialize_schema_tree_node_id - = [&output_buf]( - int8_t length_indicator_tag, - SchemaTree::Node::id_t node_id - ) { - output_buf.push_back(length_indicator_tag); - if constexpr (is_auto_generated_node) { - serialize_int( - get_ones_complement(static_cast(node_id)), - output_buf - ); - } else { - serialize_int(static_cast(node_id), output_buf); - } - }; + = [&output_buf, + &node_id](int8_t length_indicator_tag) -> void { + output_buf.push_back(length_indicator_tag); + if constexpr (is_auto_generated_node) { + serialize_int(get_ones_complement(static_cast(node_id)), output_buf); + } else { + serialize_int(static_cast(node_id), output_buf); + } + }; if (node_id <= static_cast(INT8_MAX)) { size_dependent_encode_and_serialize_schema_tree_node_id.template operator( - )(one_byte_length_indicator_tag, node_id); + )(one_byte_length_indicator_tag); } else if (node_id <= static_cast(INT16_MAX)) { size_dependent_encode_and_serialize_schema_tree_node_id.template operator( - )(two_byte_length_indicator_tag, node_id); + )(two_byte_length_indicator_tag); } else if (node_id <= static_cast(INT32_MAX)) { size_dependent_encode_and_serialize_schema_tree_node_id.template operator( - )(four_byte_length_indicator_tag, node_id); + )(four_byte_length_indicator_tag); } else { return false; }