diff libinterp/corefcn/quadcc.cc @ 32626:395ab2ffb0c2

maint: Use constexpr where possible for performance. * libinterp/corefcn/__betainc__.cc, libinterp/corefcn/__expint__.cc, libinterp/corefcn/__gammainc__.cc, libinterp/corefcn/dlmread.cc, libinterp/corefcn/gl2ps-print.cc, libinterp/corefcn/graphics.cc, libinterp/corefcn/input.cc, libinterp/corefcn/oct-stream.cc, libinterp/corefcn/quadcc.cc, libinterp/corefcn/xpow.cc, libinterp/octave-value/ov-base-int.cc, libinterp/octave-value/ov-base.cc, libinterp/octave-value/ov.cc, libinterp/operators/op-mi.cc, liboctave/array/Array-base.cc, liboctave/array/Sparse.cc, liboctave/array/idx-vector.cc, liboctave/numeric/lo-mappers.cc, liboctave/util/oct-inttypes.cc, liboctave/util/oct-inttypes.h, liboctave/util/oct-string.cc: Use "static constexpr" rather than "static const" where possible so that compiler may move some optimizations into compile stage, rather than runtime initialization. Capitalize constant expression names.
author Rik <rik@octave.org>
date Wed, 20 Dec 2023 20:02:42 -0800
parents 610a85b0ff62
children 4b601ca024d5
line wrap: on
line diff
--- a/libinterp/corefcn/quadcc.cc	Wed Dec 20 18:24:41 2023 -0800
+++ b/libinterp/corefcn/quadcc.cc	Wed Dec 20 20:02:42 2023 -0800
@@ -61,7 +61,7 @@
 };
 
 // Define relative tolerance used when deciding to drop an interval.
-static const double DROP_RELTOL = std::numeric_limits<double>::epsilon () * 10;
+static constexpr double DROP_RELTOL = std::numeric_limits<double>::epsilon () * 10;
 
 // Some constants and matrices that we'll need.