polynomial: degree computation dumbness reduced

This commit is contained in:
Mirek Kratochvil 2013-05-18 10:52:12 +02:00
parent be13fe8dca
commit 79b17b8724

View file

@ -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;
}