From 518ff584838bde25f4135b9eaf761bc7daa4c6f9 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sun, 16 Aug 2020 19:29:11 +0000 Subject: [PATCH] clang-tidy fixes for a49ec9b8d79e62be49587043cf482a9f705e3ed1 --- math/fibonacci.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/math/fibonacci.cpp b/math/fibonacci.cpp index 493523b61..79de528ea 100644 --- a/math/fibonacci.cpp +++ b/math/fibonacci.cpp @@ -17,8 +17,9 @@ unsigned int fibonacci(unsigned int n) { /* If the input is 0 or 1 just return the same This will set the first 2 values of the sequence */ - if (n <= 1) + if (n <= 1) { return n; + } /* Add the last 2 values of the sequence to get next */ return fibonacci(n - 1) + fibonacci(n - 2); @@ -58,7 +59,7 @@ static void test() { /// Main function int main() { test(); - int n; + int n = 0; std::cin >> n; assert(n >= 0); std::cout << "F(" << n << ")= " << fibonacci(n) << std::endl;