From 4b7ce3d10fdea5e4f11292ddecc2ddc0f97a7bf9 Mon Sep 17 00:00:00 2001 From: Tobias Langer Date: Sun, 6 Nov 2016 15:27:49 +0100 Subject: [PATCH] Minor optimization of the summation algorithm. --- test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.c b/test.c index 0118cc8..56ed6a4 100644 --- a/test.c +++ b/test.c @@ -5,7 +5,7 @@ int sum(int n) { - return ((n + 1) * n) / 2; + return ((n - 1) * n) / 2; } void usage(const char* app_name, const char* err_string) -- libgit2 0.26.0