From d6a5345de69cff1c1bc7e48531f9eab88c67ef1d Mon Sep 17 00:00:00 2001 From: Kipp Cannon <kipp.cannon@ligo.org> Date: Mon, 19 Nov 2018 13:02:16 +0900 Subject: [PATCH] streamthinca: small performance improvement - avoid an attribute look-up inside lower_bound_in_seglist() --- gstlal-inspiral/python/streamthinca.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gstlal-inspiral/python/streamthinca.py b/gstlal-inspiral/python/streamthinca.py index 7551992233..534b894dbc 100644 --- a/gstlal-inspiral/python/streamthinca.py +++ b/gstlal-inspiral/python/streamthinca.py @@ -41,7 +41,7 @@ # -import bisect +from bisect import bisect_right import time @@ -231,7 +231,7 @@ def lower_bound_in_seglist(seglist, x): # NOTE: this is an operation that is performed in a number of # locations in various codes, and is something that I've screwed up # more than once. maybe this should be put into segments.py itself - i = bisect.bisect_right(seglist, x) + i = bisect_right(seglist, x) return i - 1 if i else 0 -- GitLab