/// <summary>Returns true if this single info is optimized (has no
/// pending norms or deletes, is in the same dir as the
/// writer, and matches the current compound file setting
/// </summary>
private bool IsOptimized(SegmentInfo info, IState state)
{
bool hasDeletions = writer.NumDeletedDocs(info, state) > 0;
return(!hasDeletions && !info.HasSeparateNorms(state) && info.dir == writer.Directory &&
(info.GetUseCompoundFile(state) == useCompoundFile || internalNoCFSRatio < 1.0));
}