From 79b17b8724d43d6ed5d35049ff8c8b3fea74b6a1 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sat, 18 May 2013 10:52:12 +0200 Subject: [PATCH] polynomial: degree computation dumbness reduced --- src/polynomial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/polynomial.cpp b/src/polynomial.cpp index e221697..7ad47d1 100644 --- a/src/polynomial.cpp +++ b/src/polynomial.cpp @@ -23,8 +23,8 @@ int polynomial::degree() const { - int r = -1; - for (uint i = 0; i < size(); ++i) if (item (i) ) r = i; + int r; + for (r = ( (int) size() ) - 1; r >= 0; --r) if (item (r) ) break; return r; }