<commit_before>// Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

library built_collection.copy_on_write_set;

class CopyOnWriteSet<E> implements Set<E> {
  bool _copyBeforeWrite;
  Set<E> _set;

  CopyOnWriteSet(this._set) : _copyBeforeWrite = true;

  // Read-only methods: just forward.

  int get length => _set.length;

  @override
  E lookup(Object object) => _set.lookup(object);

  @override
  Set<E> intersection(Set<Object> other) => _set.intersection(other);

  @override
  Set<E> union(Set<E> other) => _set.union(other);

  @override
  Set<E> difference(Set<E> other) => _set.difference(other);

  @override
  bool containsAll(Iterable<Object> other) => _set.containsAll(other);

  @override<commit_msg>Update Set.difference signature to accept Set<Object><commit_after>// Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

library built_collection.copy_on_write_set;

class CopyOnWriteSet<E> implements Set<E> {
  bool _copyBeforeWrite;
  Set<E> _set;

  CopyOnWriteSet(this._set) : _copyBeforeWrite = true;

  // Read-only methods: just forward.

  int get length => _set.length;

  @override
  E lookup(Object object) => _set.lookup(object);

  @override
  Set<E> intersection(Set<Object> other) => _set.intersection(other);

  @override
  Set<E> union(Set<E> other) => _set.union(other);

  @override
  Set<E> difference(Set<Object> other) => _set.difference(other);

  @override
  bool containsAll(Iterable<Object> other) => _set.containsAll(other);

  @override
{'fraction_non_alphanumeric': 0.11748173130972456, 'fraction_numerical': 0.004496908375491849, 'mean_word_length': 4.476923076923077, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 36, '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': '2351816', 'n_tokens_mistral': 589, 'n_tokens_neox': 559, 'n_words': 168}