mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Check price_source precedence first to save computation.
This commit is contained in:
parent
ba4acdfef1
commit
e26e598cdc
@ -1589,6 +1589,12 @@ update_price(XferDialog *xferData, PriceReq *pr)
|
|||||||
|
|
||||||
if (gnc_numeric_equal(pr->reverse ? gnc_numeric_invert(value) : value,
|
if (gnc_numeric_equal(pr->reverse ? gnc_numeric_invert(value) : value,
|
||||||
price_value))
|
price_value))
|
||||||
|
if (gnc_price_get_source(pr->price) < xferData->price_source)
|
||||||
|
{
|
||||||
|
PINFO("Existing price is preferred, so won't supersede.");
|
||||||
|
gnc_price_unref (pr->price);
|
||||||
|
return;
|
||||||
|
}
|
||||||
{
|
{
|
||||||
PINFO("Same price for %s in %s",
|
PINFO("Same price for %s in %s",
|
||||||
gnc_commodity_get_mnemonic(pr->from),
|
gnc_commodity_get_mnemonic(pr->from),
|
||||||
@ -1596,12 +1602,6 @@ update_price(XferDialog *xferData, PriceReq *pr)
|
|||||||
gnc_price_unref (pr->price);
|
gnc_price_unref (pr->price);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (gnc_price_get_source(pr->price) < xferData->price_source)
|
|
||||||
{
|
|
||||||
PINFO("Existing price is preferred, so won't supersede.");
|
|
||||||
gnc_price_unref (pr->price);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
gnc_price_begin_edit (pr->price);
|
gnc_price_begin_edit (pr->price);
|
||||||
gnc_price_set_time (pr->price, pr->ts);
|
gnc_price_set_time (pr->price, pr->ts);
|
||||||
gnc_price_set_typestr(pr->price, xferData->price_type);
|
gnc_price_set_typestr(pr->price, xferData->price_type);
|
||||||
|
Loading…
Reference in New Issue
Block a user