Warn against using xaccTransGetSplit for iteration.

Instead of encouraging it.
This commit is contained in:
John Ralls 2020-07-20 13:07:05 -07:00
parent e9a1d49125
commit a93f3c198d

View File

@ -360,13 +360,15 @@ gboolean xaccTransGetIsClosingTxn (const Transaction *trans);
*/
#define xaccTransAppendSplit(t, s) xaccSplitSetParent((s), (t))
/** The xaccTransGetSplit() method returns a pointer to each of the
splits in this transaction.
/** Return a pointer to the indexed split in this transaction's split list.
Note that the split list is a linked list and that indexed access is
O(N). Do not use this method for iteration.
@param trans The transaction
@param i The split number. Valid values for i are zero to
(number_of__splits-1). An invalid value of i will cause NULL to
be returned. A convenient way of cycling through all splits is
to start at zero, and keep incrementing until a null value is returned. */
(number_of__splits-1).
@return A Split* or NULL if i is out of range.
*/
Split* xaccTransGetSplit (const Transaction *trans, int i);
/** Inverse of xaccTransGetSplit() */