From 22e9c1cafaa85582bb040df77ecf5dbf2498da8c Mon Sep 17 00:00:00 2001 From: Travis Date: Mon, 27 Feb 2017 11:04:37 -0600 Subject: [PATCH] modify `needsSlices()` to use `call.Name` --- executor.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/executor.go b/executor.go index 59e5fab5e..5f6b766c9 100644 --- a/executor.go +++ b/executor.go @@ -995,20 +995,20 @@ func hasOnlySetBitmapAttrs(calls []*pql.Call) bool { return true } -func needsSlices(calls pql.Calls) bool { +func needsSlices(calls []*pql.Call) bool { if len(calls) == 0 { return false } - for _, call := range calls { - if _, ok := call.(pql.BitmapCall); !ok { + switch call.Name { + case "ClearBit", "Profile", "SetBit", "SetBitmapAttrs", "SetProfileAttrs": + continue + case "Count", "TopN": return true - } else if _, ok := call.(*pql.Count); !ok { - return true - } else if _, ok := call.(*pql.TopN); !ok { + // default catches Bitmap calls + default: return true } - } return false }