Skip to content

Commit

Permalink
feat: fast path
Browse files Browse the repository at this point in the history
  • Loading branch information
fengkx committed Oct 15, 2023
1 parent 17a97df commit 5482bfb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/fava/beans/prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ def get_nested_price(
base_quote: BaseQuote,
date: datetime.date | None = None,
) -> Decimal | None:
prices_number = self.get_price(base_quote, date)
if prices_number is not None:
# fast path
return prices_number
all_commodity = [
commodity_pairs[0] for commodity_pairs in list(self._map.keys())
]
Expand Down

0 comments on commit 5482bfb

Please sign in to comment.