Use constexpr for constant instead of enum#2419
Conversation
* ACE/tests/Memcpy_Test.cpp:
|
Warning Rate limit exceeded@jwillemsen has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 27 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe changes update several constants from Changes
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
ACE/tests/Memcpy_Test.cpp (2)
75-75: Preferstd::size_t(or another unsigned type) for iteration constants
ITERATIONSis only ever used as an upper-bound/count in loops and is never expected to be negative. Declaring it asconstexpr std::size_t ITERATIONS = 100'000'000;better conveys that intent, avoids any accidental sign conversions, and future-proofs the code should the literal be increased beyond
INT_MAX.
94-106: Keep timing variables consistent & immutable
slowhas been changed toconst, butfast—computed just above—remains mutable. Making bothconst(and optionally applying a digit separator for readability) tightens correctness and surfaces intent:- double fast = 1000000 *(now.tv_sec - start.tv_sec) + - now.tv_usec - start.tv_usec; + const double fast = 1'000'000 * (now.tv_sec - start.tv_sec) + + (now.tv_usec - start.tv_usec);No functional change, just uniform const-correctness.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
ACE/tests/Memcpy_Test.cpp(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
- GitHub Check: macos-13-C++
- GitHub Check: ubuntu-24.04 g++-12
- GitHub Check: ubuntu-22.04 clang++-13
- GitHub Check: ubuntu-24.04 clang++-15
- GitHub Check: ubuntu-24.04 g++-11
- GitHub Check: ubuntu-24.04 clang++-16
- GitHub Check: ubuntu-24.04 g++-14
- GitHub Check: alpine-3.18
- GitHub Check: VS2022Debug64Cxx17
- GitHub Check: VS2022Debug64
- GitHub Check: VS2022WChar
- GitHub Check: VS2022Release64
- GitHub Check: VS2022Debug64Cxx20
- GitHub Check: VS2022WChar
- GitHub Check: VS2022Release32
- GitHub Check: MINGW64-gcc
- GitHub Check: VS2022Debug32
- GitHub Check: windows-2022 vs2022
- GitHub Check: ubuntu-24.04 g++
* ACE/tests/Memcpy_Test.cpp:
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Summary by CodeRabbit