<commit_before>import { IAheadBehind } from '../models/branch'

export class ComparisonCache {
  private backingStore = new Map<string, IAheadBehind>()

  private static getKey(from: string, to: string) {
    return `${from}...${to}`
  }

  public set(from: string, to: string, value: IAheadBehind) {
    const key = ComparisonCache.getKey(from, to)
    this.backingStore.set(key, value)
  }

  public get(from: string, to: string) {
    const key = ComparisonCache.getKey(from, to)
    return this.backingStore.get(key)
  }

  public has(from: string, to: string) {
    const key = ComparisonCache.getKey(from, to)
    return this.backingStore.has(key)
  }

  public get size() {
    return this.backingStore.size
  }

  public clear() {
    this.backingStore.clear()
  }
}<commit_msg>Don’t return undefined<commit_after>import { IAheadBehind } from '../models/branch'

export class ComparisonCache {
  private backingStore = new Map<string, IAheadBehind>()

  private static getKey(from: string, to: string) {
    return `${from}...${to}`
  }

  public set(from: string, to: string, value: IAheadBehind) {
    const key = ComparisonCache.getKey(from, to)
    this.backingStore.set(key, value)
  }

  public get(from: string, to: string) {
    const key = ComparisonCache.getKey(from, to)
    return this.backingStore.get(key) || null
  }

  public has(from: string, to: string) {
    const key = ComparisonCache.getKey(from, to)
    return this.backingStore.has(key)
  }

  public get size() {
    return this.backingStore.size
  }

  public clear() {
    this.backingStore.clear()
  }
}
{'fraction_non_alphanumeric': 0.1302706104468219, 'fraction_numerical': 0.0, 'mean_word_length': 3.5821325648414986, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6062614', 'n_tokens_mistral': 541, 'n_tokens_neox': 523, 'n_words': 129}