Advertisement
AntonyZhilin

Untitled

Jan 24th, 2024
1,432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.63 KB | None | 0 0
  1. Index: userver/core/src/utils/statistics/impl/histogram_view_utils.hpp
  2. IDEA additional info:
  3. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  4. <+>UTF-8
  5. ===================================================================
  6. diff --git a/userver/core/src/utils/statistics/impl/histogram_view_utils.hpp b/userver/core/src/utils/statistics/impl/histogram_view_utils.hpp
  7. --- a/userver/core/src/utils/statistics/impl/histogram_view_utils.hpp   (revision 89714b963aff7186947917a56b145888d17563a9)
  8. +++ b/userver/core/src/utils/statistics/impl/histogram_view_utils.hpp   (date 1706080231393)
  9. @@ -32,10 +32,13 @@
  10.  
  11.    template <typename AnyHistogramView>
  12.    static auto Bounds(AnyHistogramView view) noexcept {
  13. -    const auto bound_ref_getter = [](auto&& bucket) -> auto& {
  14. -      return bucket.upper_bound.bound;
  15. +    // GCC 8.3 ICEs on a lambda passed to transform.
  16. +    struct BoundGetter final {
  17. +      double operator()(const Bucket& bucket) const {
  18. +        return bucket.upper_bound.bound;
  19. +      }
  20.      };
  21. -    return Buckets(view) | boost::adaptors::transformed(bound_ref_getter);
  22. +    return Buckets(view) | boost::adaptors::transformed(BoundGetter{});
  23.    }
  24.  
  25.    template <typename AnyHistogramView>
  26. @@ -97,7 +100,10 @@
  27.        UINVARIANT(*upper_bounds.begin(), "Histogram bounds must be positive");
  28.      }
  29.      buckets_[0].upper_bound.size = std::size(upper_bounds);
  30. -    boost::copy(upper_bounds, Access::Bounds(*this).begin());
  31. +    for (auto [bucket, bound] :
  32. +         boost::combine(Access::Buckets(*this), upper_bounds)) {
  33. +      bucket.upper_bound.bound = bound;
  34. +    }
  35.    }
  36.  
  37.    // Atomic for 'other', non-atomic for 'this'
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement