12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System;
- using System.Collections.Generic;
- namespace Mirror
- {
- public static class Extensions
- {
-
-
- public static int GetStableHashCode(this string text)
- {
- unchecked
- {
- int hash = 23;
- foreach (char c in text)
- hash = hash * 31 + c;
- return hash;
- }
- }
-
-
- internal static string GetMethodName(this Delegate func)
- {
- #if NETFX_CORE
- return func.GetMethodInfo().Name;
- #else
- return func.Method.Name;
- #endif
- }
-
-
- public static void CopyTo<T>(this IEnumerable<T> source, List<T> destination)
- {
-
- destination.AddRange(source);
- }
- }
- }
|