const DIRECT_CRITERIA_AGGREGATE_CACHE_LIMIT = 16_384;
export function directCriteriaRangeVersionKey(state, range) {
    const sheet = state.workbook.getSheet(range.sheetName);
    return `${range.sheetName}:${range.rowStart}:${range.rowEnd}:${range.col}:${sheet?.columnVersions[range.col] ?? 0}:${sheet?.structureVersion ?? 0}`;
}
export function rememberDirectCriteriaResult(cache, key, value) {
    if (cache.size >= DIRECT_CRITERIA_AGGREGATE_CACHE_LIMIT) {
        const firstKey = cache.keys().next().value;
        if (firstKey !== undefined) {
            cache.delete(firstKey);
        }
    }
    cache.set(key, value);
    return value;
}
//# sourceMappingURL=formula-evaluation-direct-criteria-cache.js.map