fgerlits commented on code in PR #1589:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1589#discussion_r1259937618


##########
libminifi/include/utils/ArrayUtils.h:
##########
@@ -37,4 +39,35 @@ constexpr auto array_cat(const std::array<Type, sizes>&... 
arrays) {
   return result;
 }
 
+template<std::size_t size>
+constexpr auto string_view_to_array(std::string_view input) {
+  std::array<char, size> result;
+  std::copy_n(input.begin(), size, result.begin());
+  return result;
+}
+
+template<std::size_t size>
+constexpr std::string_view array_to_string_view(const std::array<char, size>& 
input) {
+  return {input.data(), input.size()};
+}
+
+template<typename Key, typename Value, size_t Size>
+constexpr std::array<Key, Size> getKeys(const std::array<std::pair<Key, 
Value>, Size>& mapping) {
+  std::array<Key, Size> result;
+  for (size_t idx = 0; idx < Size; ++idx) {
+    result.at(idx) = mapping.at(idx).first;
+  }
+  return result;
+}
+
+template<typename Container, typename ComparableToKeyType>
+constexpr auto at(const Container& mapping, ComparableToKeyType key) {
+  for (const auto& kv : mapping) {
+    if (kv.first == key) {
+      return kv.second;
+    }
+  }

Review Comment:
   fixed in 22c4a25e3707770977ff57d34fd77e59d6ce3b84



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to