Revision: 21591
Author: gervandiepen
Date: Fri Mar 27 09:52:45 2015 UTC
Log: Fixed problem if an empty set was used
https://code.google.com/p/casacore/source/detail?r=21591
Modified:
/branches/nov14/tables/TaQL/ExprLogicNode.cc
=======================================
--- /branches/nov14/tables/TaQL/ExprLogicNode.cc Wed Mar 18 15:00:56 2015
UTC
+++ /branches/nov14/tables/TaQL/ExprLogicNode.cc Fri Mar 27 09:52:45 2015
UTC
@@ -293,19 +293,21 @@
// Convert set/array to a Bool array (for direct lookup) if the range
// is sufficiently small.
Array<Int64> arr = rnode_p->getArrayInt(0);
- minMax (itsMin, itsMax, arr);
- Int64 sz = itsMax - itsMin + 1;
- if (sz <= 1024*1024) {
- itsIndex.resize (sz);
- itsIndex = False;
- Array<Int64>::const_iterator arrend = arr.end();
- for (Array<Int64>::const_iterator iter=arr.begin();
- iter!=arrend; ++iter) {
- itsIndex[*iter - itsMin] = True;
- }
- if (itsDoTracing) {
- cout << " created IN index of size " << sz
- <<" offset=" << itsMin << endl;
+ if (! arr.empty()) {
+ minMax (itsMin, itsMax, arr);
+ Int64 sz = itsMax - itsMin + 1;
+ if (sz <= 1024*1024) {
+ itsIndex.resize (sz);
+ itsIndex = False;
+ Array<Int64>::const_iterator arrend = arr.end();
+ for (Array<Int64>::const_iterator iter=arr.begin();
+ iter!=arrend; ++iter) {
+ itsIndex[*iter - itsMin] = True;
+ }
+ if (itsDoTracing) {
+ cout << " created IN index of size " << sz
+ <<" offset=" << itsMin << endl;
+ }
}
}
}