mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Warn against using xaccTransGetSplit for iteration.
Instead of encouraging it.
This commit is contained in:
parent
e9a1d49125
commit
a93f3c198d
@ -360,14 +360,16 @@ gboolean xaccTransGetIsClosingTxn (const Transaction *trans);
|
|||||||
*/
|
*/
|
||||||
#define xaccTransAppendSplit(t, s) xaccSplitSetParent((s), (t))
|
#define xaccTransAppendSplit(t, s) xaccSplitSetParent((s), (t))
|
||||||
|
|
||||||
/** The xaccTransGetSplit() method returns a pointer to each of the
|
/** Return a pointer to the indexed split in this transaction's split list.
|
||||||
splits in this transaction.
|
|
||||||
|
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 trans The transaction
|
||||||
@param i The split number. Valid values for i are zero to
|
@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
|
(number_of__splits-1).
|
||||||
be returned. A convenient way of cycling through all splits is
|
@return A Split* or NULL if i is out of range.
|
||||||
to start at zero, and keep incrementing until a null value is returned. */
|
*/
|
||||||
Split * xaccTransGetSplit (const Transaction *trans, int i);
|
Split* xaccTransGetSplit (const Transaction *trans, int i);
|
||||||
|
|
||||||
/** Inverse of xaccTransGetSplit() */
|
/** Inverse of xaccTransGetSplit() */
|
||||||
int xaccTransGetSplitIndex(const Transaction *trans, const Split *split);
|
int xaccTransGetSplitIndex(const Transaction *trans, const Split *split);
|
||||||
|
Loading…
Reference in New Issue
Block a user