Commit 996b182f authored by Marc Gravell's avatar Marc Gravell

pipeline reading code; completely non-compiling right now

parent 6af1811b
......@@ -10,6 +10,7 @@
<OutputTypeEx>Library</OutputTypeEx>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<LangVersion>7.2</LangVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net46' ">
......
......@@ -189,17 +189,18 @@ internal static unsafe int GetHashCode(byte[] value)
return acc;
}
}
internal static bool TryParseInt64(byte[] value, int offset, int count, out long result)
=> TryParseInt64(new ReadOnlySpan<byte>(value, offset, count), out result);
internal static bool TryParseInt64(ReadOnlySpan<byte> value, out long result)
{
result = 0;
if (value == null || count <= 0) return false;
if (value.IsEmpty) return false;
checked
{
int max = offset + count;
if (value[offset] == '-')
int max = value.Length;
if (value[0] == '-')
{
for (int i = offset + 1; i < max; i++)
for (int i = 1; i < max; i++)
{
var b = value[i];
if (b < '0' || b > '9') return false;
......@@ -209,7 +210,7 @@ internal static bool TryParseInt64(byte[] value, int offset, int count, out long
}
else
{
for (int i = offset; i < max; i++)
for (int i = 0; i < max; i++)
{
var b = value[i];
if (b < '0' || b > '9') return false;
......
......@@ -37,10 +37,10 @@ internal partial interface ISocketCallback
void OnHeartbeat();
/// <summary>
/// Indicates that data is available on the socket, and that the consumer should read synchronously from the socket while there is data
/// </summary>
void Read();
///// <summary>
///// Indicates that data is available on the socket, and that the consumer should read synchronously from the socket while there is data
///// </summary>
//void Read();
/// <summary>
/// Indicates that we cannot know whether data is available, and that the consume should commence reading asynchronously
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment