[gnc-pricedb.h] remove unused gnc_pricedb_lookup_at_time64

This commit is contained in:
Christopher Lam 2024-08-31 20:45:32 +08:00
parent a99491d034
commit 1718fa0b6e
4 changed files with 0 additions and 49 deletions

View File

@ -191,7 +191,6 @@ functions. */
%newobject gnc_pricedb_lookup_latest_before_any_currency_t64;
%newobject gnc_pricedb_get_prices;
%newobject gnc_pricedb_lookup_at_time;
%newobject gnc_pricedb_lookup_at_time64;
%newobject gnc_pricedb_lookup_day;
%newobject gnc_pricedb_lookup_day_t64;

View File

@ -2178,33 +2178,6 @@ gnc_pricedb_lookup_day_t64(GNCPriceDB *db,
return lookup_nearest_in_time(db, c, currency, t, TRUE);
}
// return 0 if price's time matches exactly
static int price_same_time (GNCPrice *p, time64 *time)
{
return !(gnc_price_get_time64 (p) == *time);
}
GNCPrice *
gnc_pricedb_lookup_at_time64(GNCPriceDB *db,
const gnc_commodity *c,
const gnc_commodity *currency,
time64 t)
{
GNCPrice *rv = nullptr;
if (!db || !c || !currency) return nullptr;
ENTER ("db=%p commodity=%p currency=%p", db, c, currency);
auto price_list = pricedb_get_prices_internal (db, c, currency, TRUE);
auto p = g_list_find_custom (price_list, &t, (GCompareFunc) price_same_time);
if (p)
{
rv = GNC_PRICE (p->data);
gnc_price_ref (rv);
}
g_list_free (price_list);
LEAVE (" ");
return rv;
}
static GNCPrice *
lookup_nearest_in_time(GNCPriceDB *db,
const gnc_commodity *c,

View File

@ -463,22 +463,6 @@ PriceList * gnc_pricedb_get_prices(GNCPriceDB *db,
const gnc_commodity *commodity,
const gnc_commodity *currency);
/** @brief Find the price between two commodities at a time64.
*
* The returned GNCPrice may be in either direction so check to ensure that its
* value is correctly applied.
* @param db The pricedb
* @param commodity The first commodity
* @param currency The second commodity
* @param t The time64 at which to retrieve the price.
* @return A GNCPrice or NULL if none matches.
*/
/* NOT USED */
GNCPrice * gnc_pricedb_lookup_at_time64(GNCPriceDB *db,
const gnc_commodity *commodity,
const gnc_commodity *currency,
time64 t);
/** @brief Return the price between the two commodities on the indicated
* day. Note that the notion of day might be distorted by changes in timezone.
*

View File

@ -1149,11 +1149,6 @@ test_gnc_pricedb_lookup_day_t64 (PriceDBFixture *fixture, gconstpointer pData)
g_log_set_default_handler (hdlr, 0);
}
// Not Used
/* gnc_pricedb_lookup_at_time64
GNCPrice *
gnc_pricedb_lookup_at_time64(GNCPriceDB *db,// Local: 0:0:0
*/
/* lookup_nearest_in_time
static GNCPrice *
lookup_nearest_in_time(GNCPriceDB *db,// Local: 2:0:0