CCoding Style - Be accurate

From EdWiki

Revision as of 09:30, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Be accurate

boolean inTable( object obj )
   int j = getIndex(obj);
   return ( j == nTable );

The function getIndex returns a value between zero and (nTable-1) if it finds the object, and returns nTable if not. The boolean value returned by inTable is thus the opposite of what the name implies.