All storage engines (except mobile) return true for this function.
Mobile does not support compacting, so RecordStore::compactSupported() returns false and makes the compactsInPlace() check redundant in this case.
We can assume that any storage engine that can compact will do so in-place. We may remove the compactsInPlace() check and all the alternative logic after this check inĀ collection_compact.cpp