# Problem with DeleteCases

I'm about to report this as a bug but wondered what you would make of it. Works as expected in version 7.

Union@Map[DeleteCases[#, False] &, ConstantArray[{1}, 99]]


{{1}}

Union@Map[DeleteCases[#, False] &, ConstantArray[{1}, 100]]


{{}}

• Very interesting. It is seems related to Map autocompiling as TracePrint with TraceInternal-True suggests. – LLlAMnYP Feb 21 '18 at 18:42
• I believe there are "compilation thresholds" which trigger at certain values, i.e. 99 to 100. I think there's an option to control the value it triggers at, but I always forget it. In any event, I think the output of the second is a bug, introduced at this "compilation threshold". – user6014 Feb 21 '18 at 20:00
• Definitely due to the compiling but must be a bug: SetSystemOptions["CompileOptions" -> {"MapCompileLength" -> 110}] – Mike Honeychurch Feb 21 '18 at 21:42
• This bug has been reported to Wolfram support. – Chris Degnen Feb 22 '18 at 8:48
• @ChrisDegnen of course Evaluate forces the correct result, but it is correct only by accident, since now it will not delete any False entries.. Evaluate@DeleteCase[#,False]& evaluates to #& – LLlAMnYP Feb 22 '18 at 11:04

Union@Map[DeleteCases[#, False] &, ConstantArray[{1}, 100]]