<commit_before>export const testSymbol = Symbol();
export const node1 = {
  [testSymbol]: true,
};
export const node2 = {
  [testSymbol]: undefined,
};

// TODO(asif): Get correct typings once TS/issue/1863 is resolved.
export type Node = typeof node1|typeof node2;

/**
 * Replacement for WeakSet that checks if a node exists in a set.
 * Optimized for memory usage and performance.
 */
export class NodeSet<T extends Node> {
  /** Symbol used to avoid set collisions. */
  private setSymbol: symbol;

  constructor() {
    this.setSymbol = Symbol();
  }

  /** Removes node to set. */
  public add(node: T) {
    node[this.setSymbol] = true;
  }

  /** Check if node in set. */
  public has(node: T): boolean {
    return node[this.setSymbol] === true;
  }

  /** Removes node from set. */
  public remove(node: T) {
    delete node[this.setSymbol];
  }
}<commit_msg>Fixing comment<commit_after>export const testSymbol = Symbol();
export const node1 = {
  [testSymbol]: true,
};
export const node2 = {
  [testSymbol]: undefined,
};

// TODO(asif): Get correct typings once TS/issue/1863 is resolved.
export type Node = typeof node1|typeof node2;

/**
 * Replacement for WeakSet that checks if a node exists in a set.
 * Optimized for memory usage and performance.
 */
export class NodeSet<T extends Node> {
  /** Symbol used to avoid set collisions. */
  private setSymbol: symbol;

  constructor() {
    this.setSymbol = Symbol();
  }

  /** Adds node to set. */
  public add(node: T) {
    node[this.setSymbol] = true;
  }

  /** Check if node in set. */
  public has(node: T): boolean {
    return node[this.setSymbol] === true;
  }

  /** Removes node from set. */
  public remove(node: T) {
    delete node[this.setSymbol];
  }
}
{'fraction_non_alphanumeric': 0.1313364055299539, 'fraction_numerical': 0.009216589861751152, 'mean_word_length': 3.1956521739130435, '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': '2171312', 'n_tokens_mistral': 561, 'n_tokens_neox': 541, 'n_words': 187}