[gnc-commodity.cpp] gnc_quote_source_num_entries speedup

previously was allocating a vector copy, and measuring the distance
manually. return std::list size() which is maintained internally.
This commit is contained in:
Christopher Lam committed 2026-06-19 16:30:20 +08:00
1 parent 368b2894b5
commit 54693abe30
1 file changed
+1 -2
+1 -2
View File
@@ -301,8 +301,7 @@ get_quote_source_from_type (QuoteSourceType type)
********************************************************************/
gint gnc_quote_source_num_entries(QuoteSourceType type)
{
auto source{get_quote_source_from_type(type)};
return std::distance(source.begin(), source.end());
return get_quote_source_from_type(type).size();
}