Fix benchmarking example in the main readme

This uses the same fibonacci implementation as is used in the
benchmark test.

Closes #2568
This commit is contained in:
Martin Hořeňovský 2022-12-18 21:33:33 +01:00
parent 477c1f5152
commit e6ec1c238b
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -47,7 +47,7 @@ TEST_CASE( "Factorials are computed", "[factorial]" ) {
#include <cstdint> #include <cstdint>
uint64_t fibonacci(uint64_t number) { uint64_t fibonacci(uint64_t number) {
return number < 2 ? 1 : fibonacci(number - 1) + fibonacci(number - 2); return number < 2 ? number : fibonacci(number - 1) + fibonacci(number - 2);
} }
TEST_CASE("Benchmark Fibonacci", "[!benchmark]") { TEST_CASE("Benchmark Fibonacci", "[!benchmark]") {