convert to run or array *if needed*
()
| 1273 | |
| 1274 | // convert to run or array *if needed* |
| 1275 | func (bc *bitmapContainer) toEfficientContainer() container { |
| 1276 | numRuns := bc.numberOfRuns() |
| 1277 | |
| 1278 | sizeAsRunContainer := runContainer16SerializedSizeInBytes(numRuns) |
| 1279 | sizeAsBitmapContainer := bitmapContainerSizeInBytes() |
| 1280 | card := bc.getCardinality() |
| 1281 | sizeAsArrayContainer := arrayContainerSizeInBytes(card) |
| 1282 | |
| 1283 | if sizeAsRunContainer < minOfInt(sizeAsBitmapContainer, sizeAsArrayContainer) { |
| 1284 | return newRunContainer16FromBitmapContainer(bc) |
| 1285 | } |
| 1286 | if card <= arrayDefaultMaxSize { |
| 1287 | return bc.toArrayContainer() |
| 1288 | } |
| 1289 | return bc |
| 1290 | } |
| 1291 | |
| 1292 | func newBitmapContainerFromRun(rc *runContainer16) *bitmapContainer { |
| 1293 | if len(rc.iv) == 1 { |
nothing calls this directly
no test coverage detected