[Kde-bindings] Smoke::numMethodNames of by one

Tobias Rautenkranz tobias at rautenkranz.ch
Tue Dec 9 17:59:55 UTC 2008


> > > if (icur > 0 && icur < numClasses)
>
> I think this is unnecessary and I removed it after changing numClasses to
> be the number of classes.

agreed 

> I think that numMethodNames is correct and the other ones are wrong, so
> I've now changed them all so that 'numThings' at the end of smokedata.cpp
> is always the same as the number of things in the table.
nice work.

The confusion originates from the additional "No such thing" element
at index 0.
i.e.: For n things there are n+1 elements in the array.

IMHO it's a matter of convention whether numThings = n or n+1.


Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20081209/125852ea/attachment.sig>


More information about the Kde-bindings mailing list