Browse Source

Minor changes

tags/1.0-rc
RogueException 9 years ago
parent
commit
b888ea23dc
3 changed files with 7 additions and 12 deletions
  1. +1
    -1
      src/Discord.Net.Audio/AudioClient.cs
  2. +1
    -1
      src/Discord.Net/Entities/Role.cs
  3. +5
    -10
      src/Discord.Net/InternalExtensions.cs

+ 1
- 1
src/Discord.Net.Audio/AudioClient.cs View File

@@ -255,7 +255,7 @@ namespace Discord.Audio
{
if (data == null) throw new ArgumentException(nameof(data));
if (count < 0) throw new ArgumentOutOfRangeException(nameof(count));
if (offset < 0) throw new ArgumentOutOfRangeException(nameof(count));
if (offset < 0) throw new ArgumentOutOfRangeException(nameof(offset));
if (VoiceSocket.Server == null) return; //Has been closed
if (count == 0) return;



+ 1
- 1
src/Discord.Net/Entities/Role.cs View File

@@ -9,7 +9,7 @@ using APIRole = Discord.API.Client.Role;

namespace Discord
{
public class Role : IMentionable
public class Role : IMentionable
{
private readonly static Action<Role, Role> _cloner = DynamicIL.CreateCopyMethod<Role>();



+ 5
- 10
src/Discord.Net/InternalExtensions.cs View File

@@ -10,17 +10,12 @@ namespace Discord
{
internal static readonly IFormatProvider _format = CultureInfo.InvariantCulture;
public static ulong ToId(this string value)
=> ulong.Parse(value, NumberStyles.None, _format);
public static ulong? ToNullableId(this string value)
=> value == null ? (ulong?)null : ulong.Parse(value, NumberStyles.None, _format);
public static bool TryToId(this string value, out ulong result)
=> ulong.TryParse(value, NumberStyles.None, _format, out result);
public static ulong ToId(this string value) => ulong.Parse(value, NumberStyles.None, _format);
public static ulong? ToNullableId(this string value) => value == null ? (ulong?)null : ulong.Parse(value, NumberStyles.None, _format);
public static bool TryToId(this string value, out ulong result) => ulong.TryParse(value, NumberStyles.None, _format, out result);

public static string ToIdString(this ulong value)
=> value.ToString(_format);
public static string ToIdString(this ulong? value)
=> value?.ToString(_format);
public static string ToIdString(this ulong value) => value.ToString(_format);
public static string ToIdString(this ulong? value) => value?.ToString(_format);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool HasBit(this uint rawValue, byte bit) => ((rawValue >> bit) & 1U) == 1;


Loading…
Cancel
Save