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:
Eddie Hebert
2016-06-03 14:07:00 -04:00
parent b450ab841f
commit 58467f9b3e
+4 -4
View File
@@ -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: