From db2fe6fe016abd04f1541492ab12d2dfb10b0d5f Mon Sep 17 00:00:00 2001 From: Mauro Antonio Sanz Date: Tue, 22 Oct 2024 17:06:05 -0300 Subject: [PATCH] polishing --- splitio/proxy/storage/large_segments.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/splitio/proxy/storage/large_segments.go b/splitio/proxy/storage/large_segments.go index e3c26dc3..81556c12 100644 --- a/splitio/proxy/storage/large_segments.go +++ b/splitio/proxy/storage/large_segments.go @@ -68,13 +68,12 @@ func (s *LargeSegmentsStorageImpl) names() []string { } func (s *LargeSegmentsStorageImpl) exists(lsName string, userKey string) bool { - data := s.largeSegments[lsName] - length := len(data) - if length == 0 { + data, ok := s.largeSegments[lsName] + if !ok { return false } - i := sort.Search(length, func(i int) bool { + i := sort.Search(len(data), func(i int) bool { return data[i] >= userKey })