Skip to content

Commit

Permalink
Inline ToByteArray extension method
Browse files Browse the repository at this point in the history
  • Loading branch information
Majiir committed Sep 1, 2014
1 parent 5accecd commit c8c0be9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Plugin/GeodesicGrid/CellSet.cs
Expand Up @@ -48,7 +48,9 @@ public IEnumerator<Cell> GetEnumerator()

public byte[] ToByteArray()
{
return set.ToByteArray();
byte[] ret = new byte[(set.Length - 1) / 8 + 1];
set.CopyTo(ret, 0);
return ret;
}
}
}
7 changes: 0 additions & 7 deletions Plugin/Misc.cs
Expand Up @@ -170,13 +170,6 @@ public static IEnumerable<bool> GetTypedEnumerator(this System.Collections.BitAr
}
}

public static byte[] ToByteArray(this System.Collections.BitArray bits)
{
byte[] ret = new byte[(bits.Length - 1) / 8 + 1];
bits.CopyTo(ret, 0);
return ret;
}

#endregion

public static string GetInformationalVersion(this System.Reflection.Assembly assembly)
Expand Down

0 comments on commit c8c0be9

Please sign in to comment.