mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 15:15:51 +08:00
MAINT: Only calc inverse ratio if it applies.
Avoid unneeded work by only calcultaing the inverse ratio when it applies to the current range.
This commit is contained in:
@@ -189,11 +189,11 @@ class USEquityHistoryLoader(with_metaclass(ABCMeta)):
|
||||
'splits', sid)
|
||||
for s in splits:
|
||||
dt = s[0]
|
||||
if field == 'volume':
|
||||
ratio = 1.0 / s[1]
|
||||
else:
|
||||
ratio = s[1]
|
||||
if start < dt <= end:
|
||||
if field == 'volume':
|
||||
ratio = 1.0 / s[1]
|
||||
else:
|
||||
ratio = s[1]
|
||||
end_loc = dts.searchsorted(dt)
|
||||
adj_loc = end_loc
|
||||
if is_perspective_after:
|
||||
|
||||
Reference in New Issue
Block a user