<commit_before>using System;

public sealed class Observable<T>
{
	public event Action<T> onChanged;

	private T m_ObservedField;

	public T value
	{
		get
		{
			return m_ObservedField;
		}
		set
		{
			if (object.ReferenceEquals(m_ObservedField, value))
			{
				return;
			}
			m_ObservedField = value;
			if (onChanged == null)
			{
				return;
			}
			onChanged(value);
		}
	}

	public override string ToString()
	{
		return base.ToString() + "<" + value.ToString() + ">";
	}

	public static implicit operator Observable<T>(T value)
	{
		Observable<T> observable = new Observable<T>();
		observable.value = value;
		return observable;
	}

	public static implicit operator T(Observable<T> observable)
	{
		return observable.value;
	}
}<commit_msg>Observable: Compares equal structs.<commit_after>using System;
using System.Collections.Generic;

// Generically dispatches an event when the value changes.
// Example: Editor/Tests/TestObservable.cs
//
// A tradeoff is the value is publicly exposed to changing.
public sealed class Observable<T>
{
	public event Action<T> onChanged;

	private T m_Value;

	public T value
	{
		get
		{
			return m_Value;
		}
		set
		{
			if (Equals(m_Value, value))
			{
				return;
			}
			m_Value = value;
			if (onChanged == null)
			{
				return;
			}
			onChanged(value);
		}
	}

	// Check if equal when not sure if struct or class.
	// https://stackoverflow.com/questions/390900/cant-operator-be-applied-to-generic-types-in-c
	private static bool Equals(T x, T y)
	{
		return EqualityComparer<T>.Default.Equals(x, y);
	}

	public override string ToString()
	{
		return base.ToString() + "<" + m_Value.ToString() + ">";
	}
}
{'fraction_non_alphanumeric': 0.11846061334936861, 'fraction_numerical': 0.0036079374624173183, 'mean_word_length': 3.2776349614395888, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 1, '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': '450230', 'n_tokens_mistral': 652, 'n_tokens_neox': 564, 'n_words': 144}